2D Platform Controller  v1.7.0
Autogenerated code documentation for the 2D Platform Controller.
 All Classes Functions Variables Properties
EnemyBounceAndFall Class Reference

This enemy uses only the MoveInX and MoveInY methods of the character controller. It behaves much like Super Mario enemies in that it walks in a given direction unless it runs in to something in which case it turns around. More...

Inherits RaycastCharacterController, and IEnemy.

Public Member Functions

void Kill ()
 
void KillFromAbove (HitBox other, Collider me)
 
void KillFromBelow (float force)
 
- Public Member Functions inherited from RaycastCharacterController
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 ()
 

Additional Inherited Members

- Public Attributes inherited from RaycastCharacterController
RaycastCollider[] feetColliders
 The feet colliders. These colliders push the characters upwards and also hnadle climbing. More...
 
RaycastCollider[] headColliders
 The head colliders. These characters push the chraacter down when the head is hit. More...
 
RaycastCollider[] sides
 The sides. These colliders push the character left and right when they hit obstacles. More...
 
MovementDetails movement
 The movement details, controls how the chracter moves on the ground. More...
 
JumpDetails jump
 The jump details. Controls how the character moves in the air. More...
 
WallDetails wall
 The wall details. Controls how the character interacts with walls. More...
 
SlopeDetails slopes
 The slopes details. Controls how the character handles sloped platforms. More...
 
ClimbDetails climbing
 The climbing details. Controls how a chracter handles climbables like ropes and ladders. More...
 
LedgeDetails ledgeHanging
 The ledge hanging details. Controls how a character handles ledges. More...
 
CrouchDetails crouch
 The crouch details. Controls how a chracter handles crouching. More...
 
StunType stun
 The type of stun to apply. More...
 
int backgroundLayer
 The layer of normal objects that the chracter cannot pass through. More...
 
int passThroughLayer
 The layer of object which the chracter can jump through but can not fall through. More...
 
int climableLayer
 The layer of objects the character can climb. More...
 
bool controllerActive = true
 Is the controller active. If this is false nothing will move. Use for cutscenes, static animations character death, pause, etc. More...
 
bool sendAnimationEventsEachFrame = false
 If true the animation events will be sent constantly, if false (default) only changes of state will be sent. More...
 
float groundedLookAhead = 0.25f
 How far to look ahead when considering if this character is grounded. More...
 
float maxSpeedForIdle = 0.1f
 If the character is moving slower than this they will be considered idle. More...
 
RaycastCharacterInput characterInput
 The character input that controls this character. More...
 
DirectionChecker directionChecker
 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). More...
 
- Static Public Attributes inherited from RaycastCharacterController
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...
 
- Protected Member Functions inherited from RaycastCharacterController
void UpdateAnimation ()
 Updates the animation state and sends an event. More...
 
void MoveInXDirection (bool grounded)
 
void MoveInYDirection (bool grounded)
 
- Protected Attributes inherited from RaycastCharacterController
float frameTime
 
float stunTimer
 
- Properties inherited from RaycastCharacterController
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...
 
- Events inherited from RaycastCharacterController
CharacterControllerEventDelegate CharacterAnimationEvent
 

Detailed Description

This enemy uses only the MoveInX and MoveInY methods of the character controller. It behaves much like Super Mario enemies in that it walks in a given direction unless it runs in to something in which case it turns around.

This class is a good example of how you can extend/modify the core controller to create enemy (or alternatively player) variations.


The documentation for this class was generated from the following file: