Infinite Runner Engine v1.9
|
Add this class to a character and it'll allow it to move from left to right (or down/up, or back/forward) on the axis of your choice. More...
Public Types | |
enum | PossibleMovementAxis { X , Y , Z } |
the possible axis for your character to move on More... | |
Public Member Functions | |
override void | LeftStart () |
When the player presses left, we apply a negative movement More... | |
virtual void | LeftButtonPressed () |
override void | LeftEnd () |
When the player stops pressing left, we reset our movement More... | |
override void | RightStart () |
When the player presses right, we apply a positive movement More... | |
virtual void | RightButtonPressed () |
override void | RightEnd () |
When the player stops pressing right, we reset our movement More... | |
Public Member Functions inherited from MoreMountains.InfiniteRunnerEngine.PlayableCharacter | |
virtual void | SetInitialPosition (Vector3 initialPosition) |
Use this to define the initial position of the agent. Used mainly for reset position purposes More... | |
virtual void | Disable () |
Disables the playable character More... | |
virtual void | Die () |
What happens when the object gets killed More... | |
virtual void | DisableCollisions () |
Disables the collisions. More... | |
virtual void | EnableCollisions () |
Enables the collisions. More... | |
virtual void | MainActionStart () |
What happens when the main action button button is pressed More... | |
virtual void | MainActionEnd () |
What happens when the main action button button is released More... | |
virtual void | MainActionOngoing () |
What happens when the main action button button is being pressed More... | |
virtual void | DownStart () |
What happens when the down button is pressed More... | |
virtual void | DownEnd () |
What happens when the down button is released More... | |
virtual void | DownOngoing () |
What happens when the down button is being pressed More... | |
virtual void | UpStart () |
What happens when the up button is pressed More... | |
virtual void | UpEnd () |
What happens when the up button is released More... | |
virtual void | UpOngoing () |
What happens when the up button is being pressed More... | |
virtual void | LeftOngoing () |
What happens when the left button is being pressed More... | |
virtual void | RightOngoing () |
What happens when the right button is being pressed More... | |
Public Attributes | |
PossibleMovementAxis | MovementAxis |
the axis you want your character to move on More... | |
float | MoveSpeed =5f |
the character's movement speed More... | |
float | MovementInertia |
the movement inertia (the higher it is, the longer it takes for it to stop / change direction More... | |
bool | ConstrainMovementToDeathBounds =true |
if true, the character will stop before reaching the level's death bounds More... | |
Public Attributes inherited from MoreMountains.InfiniteRunnerEngine.PlayableCharacter | |
bool | UseDefaultMecanim =true |
should we use the default mecanim ? More... | |
bool | ShouldResetPosition = true |
returns true if the character is currently grounded More... | |
float | ResetPositionSpeed = 0.5f |
float | GroundDistanceTolerance = 0.05f |
the distance tolerance at which a character is considered grounded More... | |
float | InitialInvincibilityDuration = 3f |
the duration (in seconds) of invincibility on spawn More... | |
Protected Member Functions | |
override void | Start () |
On start we set bounds and movement axis based on what's been set in the inspector More... | |
override void | Update () |
On update we just handle our character's movement More... | |
virtual void | MoveCharacter () |
Every frame, we move our character More... | |
Protected Member Functions inherited from MoreMountains.InfiniteRunnerEngine.PlayableCharacter | |
virtual void | Awake () |
Use this for initialization More... | |
virtual void | Initialize () |
This method initializes all essential elements More... | |
virtual void | ComputeDistanceToTheGround () |
Determines the distance between the Jumper and the ground More... | |
virtual bool | DetermineIfGroudedConditionsAreMet () |
Determines if grouded conditions are met. More... | |
virtual void | CheckDeathConditions () |
Checks the death conditions. More... | |
virtual Bounds | GetPlayableCharacterBounds () |
Gets the playable character bounds. More... | |
virtual void | UpdateAnimator () |
This is called at Update() and sets each of the animators parameters to their corresponding State values More... | |
virtual void | UpdateAllMecanimAnimators () |
Updates all mecanim animators. More... | |
virtual void | ResetPosition () |
Called on update, tries to return the object to its initial position More... | |
virtual void | OnCollisionEnter2D (Collision2D collidingObject) |
Handles enter collision with 2D colliders More... | |
virtual void | OnCollisionExit2D (Collision2D collidingObject) |
Handles exit collision with 2D colliders More... | |
virtual void | OnCollisionEnter (Collision collidingObject) |
Handles enter collision with 3D colliders More... | |
virtual void | OnCollisionExit (Collision collidingObject) |
Handles exit collision with 3D colliders More... | |
virtual void | OnTriggerEnter2D (Collider2D collidingObject) |
Handles enter collision with 2D triggers More... | |
virtual void | OnTriggerExit2D (Collider2D collidingObject) |
Handles enter collision with 2D triggers More... | |
virtual void | OnTriggerEnter (Collider collidingObject) |
Handles enter collision with 2D triggers More... | |
virtual void | OnTriggerExit (Collider collidingObject) |
Handles enter collision with 2D triggers More... | |
virtual void | CollisionEnter (GameObject collidingObject) |
Override this to define what happens when your playable character enters something More... | |
virtual void | CollisionExit (GameObject collidingObject) |
Override this to define what happens when your playable character exits something More... | |
virtual void | TriggerEnter (GameObject collidingObject) |
Override this to define what happens when your playable character enters a trigger More... | |
virtual void | TriggerExit (GameObject collidingObject) |
Override this to define what happens when your playable character exits a trigger More... | |
Protected Attributes | |
float | _movementLeft |
float | _movementRight |
float | _movement |
float | _currentMovement =0 |
Vector3 | _newPosition |
float | _minBound |
float | _maxBound |
float | _boundsSecurity = 10f |
Vector3 | _movementAxis |
Protected Attributes inherited from MoreMountains.InfiniteRunnerEngine.PlayableCharacter | |
Vector3 | _initialPosition |
bool | _grounded |
MMRigidbodyInterface | _rigidbodyInterface |
Animator | _animator |
float | _distanceToTheGroundRaycastLength =50f |
GameObject | _ground |
LayerMask | _collisionMaskSave |
float | _awakeAt |
Vector3 | _raycastLeftOrigin |
Vector3 | _raycastRightOrigin |
Additional Inherited Members | |
Properties inherited from MoreMountains.InfiniteRunnerEngine.PlayableCharacter | |
float | DistanceToTheGround [getprotected set] |
the distance between the character and the ground More... | |
bool | Invincible [get] |
Add this class to a character and it'll allow it to move from left to right (or down/up, or back/forward) on the axis of your choice.
|
virtual |
|
virtual |
When the player stops pressing left, we reset our movement
Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.
|
virtual |
When the player presses left, we apply a negative movement
Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.
|
protectedvirtual |
Every frame, we move our character
|
virtual |
|
virtual |
When the player stops pressing right, we reset our movement
Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.
|
virtual |
When the player presses right, we apply a positive movement
Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.
|
protectedvirtual |
On start we set bounds and movement axis based on what's been set in the inspector
Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.
Reimplemented in MoreMountains.InfiniteRunnerEngine.AlbatrossController.
|
protectedvirtual |
On update we just handle our character's movement
Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.
Reimplemented in MoreMountains.InfiniteRunnerEngine.AlbatrossController.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
bool MoreMountains.InfiniteRunnerEngine.FreeLeftToRightMovement.ConstrainMovementToDeathBounds =true |
if true, the character will stop before reaching the level's death bounds
PossibleMovementAxis MoreMountains.InfiniteRunnerEngine.FreeLeftToRightMovement.MovementAxis |
the axis you want your character to move on
float MoreMountains.InfiniteRunnerEngine.FreeLeftToRightMovement.MovementInertia |
the movement inertia (the higher it is, the longer it takes for it to stop / change direction
float MoreMountains.InfiniteRunnerEngine.FreeLeftToRightMovement.MoveSpeed =5f |
the character's movement speed