Infinite Runner Engine v1.9
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
MoreMountains.InfiniteRunnerEngine.PlayableCharacter Class Reference

You should extend this class for all your playable characters The asset includes a bunch of examples of how you can do that : Jumper, Flappy, Dragon, etc... More...

Inheritance diagram for MoreMountains.InfiniteRunnerEngine.PlayableCharacter:
MoreMountains.InfiniteRunnerEngine.Flappy MoreMountains.InfiniteRunnerEngine.FreeLeftToRightMovement MoreMountains.InfiniteRunnerEngine.Jumper MoreMountains.InfiniteRunnerEngine.LaneRunner MoreMountains.InfiniteRunnerEngine.LeftRightMove MoreMountains.InfiniteRunnerEngine.Rocket MoreMountains.InfiniteRunnerEngine.Dragon MoreMountains.InfiniteRunnerEngine.AlbatrossController MoreMountains.InfiniteRunnerEngine.HillRider MoreMountains.InfiniteRunnerEngine.VerticalCharacter MoreMountains.InfiniteRunnerEngine.CaveRacer

Public Member Functions

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 LeftStart ()
 What happens when the left button is pressed More...
 
virtual void LeftEnd ()
 What happens when the left button is released More...
 
virtual void LeftOngoing ()
 What happens when the left button is being pressed More...
 
virtual void RightStart ()
 What happens when the right button is pressed More...
 
virtual void RightEnd ()
 What happens when the right button is released More...
 
virtual void RightOngoing ()
 What happens when the right button is being pressed More...
 

Public Attributes

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

virtual void Awake ()
 Use this for initialization More...
 
virtual void Start ()
 On start - Override this if needed More...
 
virtual void Initialize ()
 This method initializes all essential elements More...
 
virtual void Update ()
 
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

Vector3 _initialPosition
 
bool _grounded
 
MMRigidbodyInterface _rigidbodyInterface
 
Animator _animator
 
float _distanceToTheGroundRaycastLength =50f
 
GameObject _ground
 
LayerMask _collisionMaskSave
 
float _awakeAt
 
Vector3 _raycastLeftOrigin
 
Vector3 _raycastRightOrigin
 

Properties

float DistanceToTheGround [getprotected set]
 the distance between the character and the ground More...
 
bool Invincible [get]
 

Detailed Description

You should extend this class for all your playable characters The asset includes a bunch of examples of how you can do that : Jumper, Flappy, Dragon, etc...

Member Function Documentation

◆ Awake()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.Awake ( )
protectedvirtual

◆ CheckDeathConditions()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.CheckDeathConditions ( )
protectedvirtual

Checks the death conditions.

◆ CollisionEnter()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.CollisionEnter ( GameObject  collidingObject)
protectedvirtual

Override this to define what happens when your playable character enters something

Parameters
collidingObjectColliding object.

Reimplemented in MoreMountains.InfiniteRunnerEngine.VerticalCharacter.

◆ CollisionExit()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.CollisionExit ( GameObject  collidingObject)
protectedvirtual

Override this to define what happens when your playable character exits something

Parameters
collidingObjectColliding object.

◆ ComputeDistanceToTheGround()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.ComputeDistanceToTheGround ( )
protectedvirtual

Determines the distance between the Jumper and the ground

◆ DetermineIfGroudedConditionsAreMet()

virtual bool MoreMountains.InfiniteRunnerEngine.PlayableCharacter.DetermineIfGroudedConditionsAreMet ( )
protectedvirtual

Determines if grouded conditions are met.

Returns
true, if if grouded conditions are met was determined, false otherwise.

◆ Die()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.Die ( )
virtual

◆ Disable()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.Disable ( )
virtual

Disables the playable character

◆ DisableCollisions()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.DisableCollisions ( )
virtual

Disables the collisions.

◆ DownEnd()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.DownEnd ( )
virtual

What happens when the down button is released

◆ DownOngoing()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.DownOngoing ( )
virtual

What happens when the down button is being pressed

◆ DownStart()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.DownStart ( )
virtual

What happens when the down button is pressed

◆ EnableCollisions()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.EnableCollisions ( )
virtual

Enables the collisions.

◆ GetPlayableCharacterBounds()

virtual Bounds MoreMountains.InfiniteRunnerEngine.PlayableCharacter.GetPlayableCharacterBounds ( )
protectedvirtual

Gets the playable character bounds.

Returns
The playable character bounds.

◆ Initialize()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.Initialize ( )
protectedvirtual

This method initializes all essential elements

Reimplemented in MoreMountains.InfiniteRunnerEngine.HillRider, and MoreMountains.InfiniteRunnerEngine.VerticalCharacter.

◆ LeftEnd()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.LeftEnd ( )
virtual

What happens when the left button is released

Reimplemented in MoreMountains.InfiniteRunnerEngine.FreeLeftToRightMovement.

◆ LeftOngoing()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.LeftOngoing ( )
virtual

What happens when the left button is being pressed

Reimplemented in MoreMountains.InfiniteRunnerEngine.LeftRightMove.

◆ LeftStart()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.LeftStart ( )
virtual

◆ MainActionEnd()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.MainActionEnd ( )
virtual

What happens when the main action button button is released

Reimplemented in MoreMountains.InfiniteRunnerEngine.Jumper, MoreMountains.InfiniteRunnerEngine.Rocket, and MoreMountains.InfiniteRunnerEngine.Flappy.

◆ MainActionOngoing()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.MainActionOngoing ( )
virtual

What happens when the main action button button is being pressed

◆ MainActionStart()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.MainActionStart ( )
virtual

◆ OnCollisionEnter()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.OnCollisionEnter ( Collision  collidingObject)
protectedvirtual

Handles enter collision with 3D colliders

Parameters
collidingObjectColliding object.

◆ OnCollisionEnter2D()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.OnCollisionEnter2D ( Collision2D  collidingObject)
protectedvirtual

Handles enter collision with 2D colliders

Parameters
collidingObjectColliding object.

◆ OnCollisionExit()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.OnCollisionExit ( Collision  collidingObject)
protectedvirtual

Handles exit collision with 3D colliders

Parameters
collidingObjectOther.

◆ OnCollisionExit2D()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.OnCollisionExit2D ( Collision2D  collidingObject)
protectedvirtual

Handles exit collision with 2D colliders

Parameters
collidingObjectColliding object.

◆ OnTriggerEnter()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.OnTriggerEnter ( Collider  collidingObject)
protectedvirtual

Handles enter collision with 2D triggers

Parameters
collidingObjectColliding object.

◆ OnTriggerEnter2D()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.OnTriggerEnter2D ( Collider2D  collidingObject)
protectedvirtual

Handles enter collision with 2D triggers

Parameters
collidingObjectColliding object.

◆ OnTriggerExit()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.OnTriggerExit ( Collider  collidingObject)
protectedvirtual

Handles enter collision with 2D triggers

Parameters
collidingObjectColliding object.

◆ OnTriggerExit2D()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.OnTriggerExit2D ( Collider2D  collidingObject)
protectedvirtual

Handles enter collision with 2D triggers

Parameters
collidingObjectColliding object.

◆ ResetPosition()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.ResetPosition ( )
protectedvirtual

Called on update, tries to return the object to its initial position

◆ RightEnd()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.RightEnd ( )
virtual

What happens when the right button is released

Reimplemented in MoreMountains.InfiniteRunnerEngine.FreeLeftToRightMovement.

◆ RightOngoing()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.RightOngoing ( )
virtual

What happens when the right button is being pressed

Reimplemented in MoreMountains.InfiniteRunnerEngine.LeftRightMove.

◆ RightStart()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.RightStart ( )
virtual

◆ SetInitialPosition()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.SetInitialPosition ( Vector3  initialPosition)
virtual

Use this to define the initial position of the agent. Used mainly for reset position purposes

Parameters
initialPositionInitial position.

◆ Start()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.Start ( )
protectedvirtual

◆ TriggerEnter()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.TriggerEnter ( GameObject  collidingObject)
protectedvirtual

Override this to define what happens when your playable character enters a trigger

Parameters
collidingObjectColliding object.

Reimplemented in MoreMountains.InfiniteRunnerEngine.CaveRacer.

◆ TriggerExit()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.TriggerExit ( GameObject  collidingObject)
protectedvirtual

Override this to define what happens when your playable character exits a trigger

Parameters
collidingObjectColliding object.

◆ Update()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.Update ( )
protectedvirtual

◆ UpdateAllMecanimAnimators()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.UpdateAllMecanimAnimators ( )
protectedvirtual

◆ UpdateAnimator()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.UpdateAnimator ( )
protectedvirtual

This is called at Update() and sets each of the animators parameters to their corresponding State values

◆ UpEnd()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.UpEnd ( )
virtual

What happens when the up button is released

◆ UpOngoing()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.UpOngoing ( )
virtual

What happens when the up button is being pressed

◆ UpStart()

virtual void MoreMountains.InfiniteRunnerEngine.PlayableCharacter.UpStart ( )
virtual

What happens when the up button is pressed

Member Data Documentation

◆ _animator

Animator MoreMountains.InfiniteRunnerEngine.PlayableCharacter._animator
protected

◆ _awakeAt

float MoreMountains.InfiniteRunnerEngine.PlayableCharacter._awakeAt
protected

◆ _collisionMaskSave

LayerMask MoreMountains.InfiniteRunnerEngine.PlayableCharacter._collisionMaskSave
protected

◆ _distanceToTheGroundRaycastLength

float MoreMountains.InfiniteRunnerEngine.PlayableCharacter._distanceToTheGroundRaycastLength =50f
protected

◆ _ground

GameObject MoreMountains.InfiniteRunnerEngine.PlayableCharacter._ground
protected

◆ _grounded

bool MoreMountains.InfiniteRunnerEngine.PlayableCharacter._grounded
protected

◆ _initialPosition

Vector3 MoreMountains.InfiniteRunnerEngine.PlayableCharacter._initialPosition
protected

◆ _raycastLeftOrigin

Vector3 MoreMountains.InfiniteRunnerEngine.PlayableCharacter._raycastLeftOrigin
protected

◆ _raycastRightOrigin

Vector3 MoreMountains.InfiniteRunnerEngine.PlayableCharacter._raycastRightOrigin
protected

◆ _rigidbodyInterface

MMRigidbodyInterface MoreMountains.InfiniteRunnerEngine.PlayableCharacter._rigidbodyInterface
protected

◆ GroundDistanceTolerance

float MoreMountains.InfiniteRunnerEngine.PlayableCharacter.GroundDistanceTolerance = 0.05f

the distance tolerance at which a character is considered grounded

◆ InitialInvincibilityDuration

float MoreMountains.InfiniteRunnerEngine.PlayableCharacter.InitialInvincibilityDuration = 3f

the duration (in seconds) of invincibility on spawn

◆ ResetPositionSpeed

float MoreMountains.InfiniteRunnerEngine.PlayableCharacter.ResetPositionSpeed = 0.5f

◆ ShouldResetPosition

bool MoreMountains.InfiniteRunnerEngine.PlayableCharacter.ShouldResetPosition = true

returns true if the character is currently grounded

◆ UseDefaultMecanim

bool MoreMountains.InfiniteRunnerEngine.PlayableCharacter.UseDefaultMecanim =true

should we use the default mecanim ?

Property Documentation

◆ DistanceToTheGround

float MoreMountains.InfiniteRunnerEngine.PlayableCharacter.DistanceToTheGround
getprotected set

the distance between the character and the ground

◆ Invincible

bool MoreMountains.InfiniteRunnerEngine.PlayableCharacter.Invincible
get

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