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

Controller for the CaveRacer playable character More...

Inheritance diagram for MoreMountains.InfiniteRunnerEngine.CaveRacer:
MoreMountains.InfiniteRunnerEngine.Rocket MoreMountains.InfiniteRunnerEngine.PlayableCharacter

Public Member Functions

override void MainActionStart ()
 When pressing the main action button for the first time we start boosting More...
 
override void Die ()
 When the CaveRacer gets destroyed, we add an explosion More...
 
- Public Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Rocket
override void MainActionEnd ()
 When we stop pressing the main action button, we stop boosting More...
 
virtual void Fly ()
 When the rocket is boosting we add a vertical force to make it climb. Gravity will handle the rest 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 DisableCollisions ()
 Disables the collisions. More...
 
virtual void EnableCollisions ()
 Enables the collisions. 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

GameObject RocketContainer
 the rocket container More...
 
GameObject ActualRocket
 the rocket gameobject (separate for finer control over its axis) More...
 
ParticleSystem ReactorLeft
 the left reactor particle system More...
 
ParticleSystem ReactorRight
 the right reactor particle system More...
 
GameObject Explosion
 the explosion that happens when the plane hits the ground More...
 
Vector3 DeathShakeVector = new Vector3(2f,2f,2f)
 the shake vector we'll apply to the camera on death More...
 
AudioClip DeathSoundFx
 the sound fx we'll play on death More...
 
- Public Attributes inherited from MoreMountains.InfiniteRunnerEngine.Rocket
float FlyForce = 20f
 The force applied when pressing the main button. More...
 
float MaximumVelocity = 5f
 The maximum velocity. 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 ()
 Init More...
 
override void Update ()
 On update we handle flight, orientation and reactors More...
 
virtual void HandleOrientation ()
 Handles the orientation of the plane based on speed and altitude. More...
 
virtual void HandleReactors ()
 If we're boosting, we'll increase the size of the reactor's effects More...
 
virtual IEnumerator BarrelRoll (float delay)
 Performs a barrel roll More...
 
override void TriggerEnter (GameObject collidingObject)
 Triggered when entering a trigger (in this case probably a coin or a power up) More...
 
- Protected Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Rocket
virtual void FixedUpdate ()
 On fixed update 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 TriggerExit (GameObject collidingObject)
 Override this to define what happens when your playable character exits a trigger More...
 

Protected Attributes

float _horizontalRotationSpeed =5f
 
float _verticalRotationSpeed =2f
 
Vector3 _newAngle = Vector3.zero
 
float _horizontalRotationTarget
 
bool _barrelRolling =false
 
- Protected Attributes inherited from MoreMountains.InfiniteRunnerEngine.Rocket
bool _boosting =false
 
- 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]
 

Detailed Description

Controller for the CaveRacer playable character

Member Function Documentation

◆ BarrelRoll()

virtual IEnumerator MoreMountains.InfiniteRunnerEngine.CaveRacer.BarrelRoll ( float  delay)
protectedvirtual

Performs a barrel roll

Returns
The roll.
Parameters
delayDelay.

◆ Die()

override void MoreMountains.InfiniteRunnerEngine.CaveRacer.Die ( )
virtual

When the CaveRacer gets destroyed, we add an explosion

Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.

◆ HandleOrientation()

virtual void MoreMountains.InfiniteRunnerEngine.CaveRacer.HandleOrientation ( )
protectedvirtual

Handles the orientation of the plane based on speed and altitude.

◆ HandleReactors()

virtual void MoreMountains.InfiniteRunnerEngine.CaveRacer.HandleReactors ( )
protectedvirtual

If we're boosting, we'll increase the size of the reactor's effects

◆ MainActionStart()

override void MoreMountains.InfiniteRunnerEngine.CaveRacer.MainActionStart ( )
virtual

When pressing the main action button for the first time we start boosting

Reimplemented from MoreMountains.InfiniteRunnerEngine.Rocket.

◆ Start()

override void MoreMountains.InfiniteRunnerEngine.CaveRacer.Start ( )
protectedvirtual

◆ TriggerEnter()

override void MoreMountains.InfiniteRunnerEngine.CaveRacer.TriggerEnter ( GameObject  collidingObject)
protectedvirtual

Triggered when entering a trigger (in this case probably a coin or a power up)

Parameters
collidingObjectColliding object.

Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.

◆ Update()

override void MoreMountains.InfiniteRunnerEngine.CaveRacer.Update ( )
protectedvirtual

On update we handle flight, orientation and reactors

Reimplemented from MoreMountains.InfiniteRunnerEngine.Rocket.

Member Data Documentation

◆ _barrelRolling

bool MoreMountains.InfiniteRunnerEngine.CaveRacer._barrelRolling =false
protected

◆ _horizontalRotationSpeed

float MoreMountains.InfiniteRunnerEngine.CaveRacer._horizontalRotationSpeed =5f
protected

◆ _horizontalRotationTarget

float MoreMountains.InfiniteRunnerEngine.CaveRacer._horizontalRotationTarget
protected

◆ _newAngle

Vector3 MoreMountains.InfiniteRunnerEngine.CaveRacer._newAngle = Vector3.zero
protected

◆ _verticalRotationSpeed

float MoreMountains.InfiniteRunnerEngine.CaveRacer._verticalRotationSpeed =2f
protected

◆ ActualRocket

GameObject MoreMountains.InfiniteRunnerEngine.CaveRacer.ActualRocket

the rocket gameobject (separate for finer control over its axis)

◆ DeathShakeVector

Vector3 MoreMountains.InfiniteRunnerEngine.CaveRacer.DeathShakeVector = new Vector3(2f,2f,2f)

the shake vector we'll apply to the camera on death

◆ DeathSoundFx

AudioClip MoreMountains.InfiniteRunnerEngine.CaveRacer.DeathSoundFx

the sound fx we'll play on death

◆ Explosion

GameObject MoreMountains.InfiniteRunnerEngine.CaveRacer.Explosion

the explosion that happens when the plane hits the ground

◆ ReactorLeft

ParticleSystem MoreMountains.InfiniteRunnerEngine.CaveRacer.ReactorLeft

the left reactor particle system

◆ ReactorRight

ParticleSystem MoreMountains.InfiniteRunnerEngine.CaveRacer.ReactorRight

the right reactor particle system

◆ RocketContainer

GameObject MoreMountains.InfiniteRunnerEngine.CaveRacer.RocketContainer

the rocket container


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