Raycast character controller a controller for 2D platform games.
More...
Inherits MonoBehaviour.
Inherited by EnemyBounceAndFall.
|
|
delegate void | CharacterControllerEventDelegate (CharacterState state, CharacterState previousState) |
| |
| void | SetDrag (float drag) |
| | Sets the drag for the current frame. Use this to implement slippery or sticky platforms. More...
|
| |
| void | Dismount (Ladder ladder) |
| | Dismount the specified Ladder. This is used to stop autosticking to the same ladder you just dismounted. More...
|
| |
| bool | Unparent (Platform platform) |
| | Force the character to unparent from the given object. More...
|
| |
| void | ForceSetCharacterState (CharacterState state) |
| | Forces the state of the character to be the provided value. More...
|
| |
| bool | IsGrounded (float offset, bool includeClimables=true) |
| | Determines whether this character is grounded. More...
|
| |
| void | SwitchColliders () |
| | Switches the colliders direction. This is a default implementation a direction checker may choose to do something different. This is primarily for assymetrical characters. More...
|
| |
| void | Stun (float stunTime) |
| | Stuns the character so it cannot move for the specified time. The exact definition of "cannot move" depends on the stun settings. A stun animation event will also be sent. More...
|
| |
|
void | DoCrouch () |
| |
|
| static float | maxFrameTime = 0.033f |
| | The maximum time a frame can take. Smaller values allow your character to move faster, larger values will tend to make lag less apparent. Static so it is the same across all components. WARNING: If this is too large your character can fall through the ground, or move through small platforms. More...
|
| |
|
|
float | frameTime |
| |
|
float | stunTimer |
| |
|
| bool | IsClimbingUpOrDown [get] |
| | Gets a value indicating whether the cahracter is climbing up or down (as opposed to just holding on to a climbable). Value is undefined if StartedClimbing = false; More...
|
| |
| Vector2 | Velocity [get, set] |
| | Gets or sets the velocity. You can interact with this directly in order to create (for example) escalators or coveyer belts. More...
|
| |
| bool | StartedClimbing [get] |
| | Gets a value indicating whether this RaycastCharacterController has started climbing a climbable More...
|
| |
| CharacterState | State [get, set] |
| | Get the animation state of the character. You can use this for animation as an alternative to listening to events. More...
|
| |
| Platform | MyParent [get] |
| | Gets the parent platform More...
|
| |
| float | FallThroughTimer [get, set] |
| | Sets the fall through timer (used by passthrough platforms). More...
|
| |
| int | CurrentDirection [get] |
| | The current direction being faced. 0 = NONE, 1 = RIGHT -1 = LEFT. Uses a direction checker if one is assigned else the character will face the direction that is being held or the direction they are moving in. More...
|
| |
| static float | FrameTime [get] |
| | Gets the frame time. More...
|
| |
| int | GroundedFeetCount [get] |
| | Returns how many of the feet colliders are on the ground. You can use this to play a "teeter" animation. More...
|
| |
| bool | IsLedgeHanging [get] |
| | Gets a value indicating if the character is ledge hanging. More...
|
| |
| RC_Direction | LedgeHangDirection [get] |
| | Gets a value indicating the direciton the character is hanging. Value has no meaning if the character is not ledge hanging. More...
|
| |
Raycast character controller a controller for 2D platform games.
| void RaycastCharacterController.Dismount |
( |
Ladder |
ladder) | |
|
Dismount the specified Ladder. This is used to stop autosticking to the same ladder you just dismounted.
- Parameters
-
| ladder | Ladder control to dismount. |
| void RaycastCharacterController.ForceSetCharacterState |
( |
CharacterState |
state) | |
|
Forces the state of the character to be the provided value.
- Parameters
-
| bool RaycastCharacterController.IsGrounded |
( |
float |
offset, |
|
|
bool |
includeClimables = true |
|
) |
| |
Determines whether this character is grounded.
- Returns
true if this instance is grounded; otherwise, false.
- Parameters
-
| offset | How much to look ahead from the feet colliders when determining if the character is grounded. |
| void RaycastCharacterController.MoveInXDirection |
( |
bool |
grounded) | |
|
|
protected |
| void RaycastCharacterController.SetDrag |
( |
float |
drag) | |
|
Sets the drag for the current frame. Use this to implement slippery or sticky platforms.
- Parameters
-
| drag | Drag for the current frame. |
| void RaycastCharacterController.Stun |
( |
float |
stunTime) | |
|
Stuns the character so it cannot move for the specified time. The exact definition of "cannot move" depends on the stun settings. A stun animation event will also be sent.
- Parameters
-
| void RaycastCharacterController.SwitchColliders |
( |
) | |
|
Switches the colliders direction. This is a default implementation a direction checker may choose to do something different. This is primarily for assymetrical characters.
| bool RaycastCharacterController.Unparent |
( |
Platform |
platform) | |
|
Force the character to unparent from the given object.
- Returns
- true if the object was parented to the supplied platform and then successfully unparented.
- Parameters
-
| platform | The platform to unparent from. |
| void RaycastCharacterController.UpdateAnimation |
( |
) | |
|
|
protected |
Updates the animation state and sends an event.
| int RaycastCharacterController.backgroundLayer |
The layer of normal objects that the chracter cannot pass through.
The character input that controls this character.
| int RaycastCharacterController.climableLayer |
The layer of objects the character can climb.
The climbing details. Controls how a chracter handles climbables like ropes and ladders.
| bool RaycastCharacterController.controllerActive = true |
Is the controller active. If this is false nothing will move. Use for cutscenes, static animations character death, pause, etc.
The crouch details. Controls how a chracter handles crouching.
Assign a direction checker if you want to do one of two things. 1) Determine the way the character is facing using a mechanism other than the default (for example based on mouse position) OR 2) Switch or change colliders based on the direction the character is facing (for example if you have an assymetrical character).
The feet colliders. These colliders push the characters upwards and also hnadle climbing.
| float RaycastCharacterController.groundedLookAhead = 0.25f |
How far to look ahead when considering if this character is grounded.
The head colliders. These characters push the chraacter down when the head is hit.
The jump details. Controls how the character moves in the air.
The ledge hanging details. Controls how a character handles ledges.
| float RaycastCharacterController.maxFrameTime = 0.033f |
|
static |
The maximum time a frame can take. Smaller values allow your character to move faster, larger values will tend to make lag less apparent. Static so it is the same across all components. WARNING: If this is too large your character can fall through the ground, or move through small platforms.
| float RaycastCharacterController.maxSpeedForIdle = 0.1f |
If the character is moving slower than this they will be considered idle.
The movement details, controls how the chracter moves on the ground.
| int RaycastCharacterController.passThroughLayer |
The layer of object which the chracter can jump through but can not fall through.
| bool RaycastCharacterController.sendAnimationEventsEachFrame = false |
If true the animation events will be sent constantly, if false (default) only changes of state will be sent.
The sides. These colliders push the character left and right when they hit obstacles.
The slopes details. Controls how the character handles sloped platforms.
| StunType RaycastCharacterController.stun |
The type of stun to apply.
The wall details. Controls how the character interacts with walls.
| int RaycastCharacterController.CurrentDirection |
|
get |
The current direction being faced. 0 = NONE, 1 = RIGHT -1 = LEFT. Uses a direction checker if one is assigned else the character will face the direction that is being held or the direction they are moving in.
| float RaycastCharacterController.FallThroughTimer |
|
getset |
Sets the fall through timer (used by passthrough platforms).
| float RaycastCharacterController.FrameTime |
|
staticget |
Gets the frame time.
The frame time.
| int RaycastCharacterController.GroundedFeetCount |
|
get |
Returns how many of the feet colliders are on the ground. You can use this to play a "teeter" animation.
| bool RaycastCharacterController.IsClimbingUpOrDown |
|
get |
Gets a value indicating whether the cahracter is climbing up or down (as opposed to just holding on to a climbable). Value is undefined if StartedClimbing = false;
| bool RaycastCharacterController.IsLedgeHanging |
|
get |
Gets a value indicating if the character is ledge hanging.
| RC_Direction RaycastCharacterController.LedgeHangDirection |
|
get |
Gets a value indicating the direciton the character is hanging. Value has no meaning if the character is not ledge hanging.
| Platform RaycastCharacterController.MyParent |
|
get |
| bool RaycastCharacterController.StartedClimbing |
|
get |
Gets a value indicating whether this RaycastCharacterController has started climbing a climbable
true if started climbing; otherwise, false.
| CharacterState RaycastCharacterController.State |
|
getset |
Get the animation state of the character. You can use this for animation as an alternative to listening to events.
The current animation state.
| Vector2 RaycastCharacterController.Velocity |
|
getset |
Gets or sets the velocity. You can interact with this directly in order to create (for example) escalators or coveyer belts.
The velocity.
The documentation for this class was generated from the following file:
- /Users/john/Desktop/PC3.5Test/Assets/2DPlatformController/Scripts/Plugins/RaycastCharacterController.cs