Infinite Runner Engine v2.2
Loading...
Searching...
No Matches
MoreMountains.InfiniteRunnerEngine.HillRider Class Reference
Inheritance diagram for MoreMountains.InfiniteRunnerEngine.HillRider:
MoreMountains.InfiniteRunnerEngine.Jumper MoreMountains.InfiniteRunnerEngine.PlayableCharacter

Public Member Functions

override void Jump ()
override void Die ()
 What happens when the object gets killed.
Public Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Jumper
override void MainActionStart ()
 What happens when the main action button button is pressed.
override void MainActionEnd ()
 What happens when the main action button button is released.
virtual IEnumerator JumpSlow ()
 Slows the player's jump.
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.
virtual void Disable ()
 Disables the playable character.
virtual void DisableCollisions ()
 Disables the collisions.
virtual void EnableCollisions ()
 Enables the collisions.
virtual void MainActionOngoing ()
 What happens when the main action button button is being pressed.
virtual void DownStart ()
 What happens when the down button is pressed.
virtual void DownEnd ()
 What happens when the down button is released.
virtual void DownOngoing ()
 What happens when the down button is being pressed.
virtual void UpStart ()
 What happens when the up button is pressed.
virtual void UpEnd ()
 What happens when the up button is released.
virtual void UpOngoing ()
 What happens when the up button is being pressed.
virtual void LeftStart ()
 What happens when the left button is pressed.
virtual void LeftEnd ()
 What happens when the left button is released.
virtual void LeftOngoing ()
 What happens when the left button is being pressed.
virtual void RightStart ()
 What happens when the right button is pressed.
virtual void RightEnd ()
 What happens when the right button is released.
virtual void RightOngoing ()
 What happens when the right button is being pressed.

Public Attributes

float Acceleration = 100f
float MaxSpeed = 8f
float GroundDetectionMaxY = 500000f
float RaycastLength = 1000000f
GameObject ModelContainer
float CharacterRotationSpeed = 10f
float MinimumAllowedAngle = -90f
float MaximumAllowedAngle = 90f
bool ResetAngleInTheAir = true
ParticleSystem DustParticles
GameObject Explosion
 the explosion that happens when the dragon hits the ground
Public Attributes inherited from MoreMountains.InfiniteRunnerEngine.Jumper
float JumpForce = 20f
 the vertical force applied to the character when jumping
int NumberOfJumpsAllowed = 2
 the number of jumps allowed
float CooldownBetweenJumps = 0f
 the minimum time (in seconds) allowed between two consecutive jumps
bool JumpsAllowedWhenGroundedOnly
 can the character jump only when grounded ?
float JumpReleaseSpeed = 50f
 the speed at which the character falls back down again when the jump button is released
bool JumpProportionalToPress = true
 if this is set to false, the jump height won't depend on the jump button release speed
float MinimalDelayBetweenJumps = 0.02f
 the minimal time, in seconds, that needs to have passed for a new jump to be authorized
float UngroundedDurationAfterJump = 0.2f
 a duration, after a jump, during which the character can't be considered grounded (to avoid jumps left to be reset too soon depending on context)
int _numberOfJumpsLeft
Public Attributes inherited from MoreMountains.InfiniteRunnerEngine.PlayableCharacter
bool UseDefaultMecanim = true
 should we use the default mecanim ?
bool ShouldResetPosition = true
 returns true if the character is currently grounded
float ResetPositionSpeed = 0.5f
float GroundDistanceTolerance = 0.05f
 the distance tolerance at which a character is considered grounded
float InitialInvincibilityDuration = 3f
 the duration (in seconds) of invincibility on spawn

Protected Member Functions

override void Initialize ()
 On awake, we handle initialization.
override void Update ()
 On update we handle the animator's update.
virtual void DetectGround ()
virtual void LateUpdate ()
virtual void RemainAboveGround ()
virtual void AngleCharacter ()
virtual void SlopeBoost ()
virtual void FixedUpdate ()
virtual void CharacterMovement ()
virtual void PrepareJump ()
override void ApplyJumpForce ()
override void UpdateAllMecanimAnimators ()
 Updates all mecanim animators.
Protected Member Functions inherited from MoreMountains.InfiniteRunnerEngine.Jumper
override void Start ()
 On Start() we initialize the last jump time.
override void Update ()
 On update, we update the animator and try to reset the jumper's position.
override void UpdateAllMecanimAnimators ()
 Updates all mecanim animators.
virtual void PerformJump ()
virtual bool EvaluateJumpConditions ()
Protected Member Functions inherited from MoreMountains.InfiniteRunnerEngine.PlayableCharacter
virtual void Awake ()
 Use this for initialization.
virtual void ComputeDistanceToTheGround ()
 Determines the distance between the Jumper and the ground.
virtual bool DetermineIfGroudedConditionsAreMet ()
 Determines if grouded conditions are met.
virtual void CheckDeathConditions ()
 Checks the death conditions.
virtual Bounds GetPlayableCharacterBounds ()
 Gets the playable character bounds.
virtual void UpdateAnimator ()
 This is called at Update() and sets each of the animators parameters to their corresponding State values.
virtual void ResetPosition ()
 Called on update, tries to return the object to its initial position.
virtual void OnCollisionEnter2D (Collision2D collidingObject)
 Handles enter collision with 2D colliders.
virtual void OnCollisionExit2D (Collision2D collidingObject)
 Handles exit collision with 2D colliders.
virtual void OnCollisionEnter (Collision collidingObject)
 Handles enter collision with 3D colliders.
virtual void OnCollisionExit (Collision collidingObject)
 Handles exit collision with 3D colliders.
virtual void OnTriggerEnter2D (Collider2D collidingObject)
 Handles enter collision with 2D triggers.
virtual void OnTriggerExit2D (Collider2D collidingObject)
 Handles enter collision with 2D triggers.
virtual void OnTriggerEnter (Collider collidingObject)
 Handles enter collision with 2D triggers.
virtual void OnTriggerExit (Collider collidingObject)
 Handles enter collision with 2D triggers.
virtual void CollisionEnter (GameObject collidingObject)
 Override this to define what happens when your playable character enters something.
virtual void CollisionExit (GameObject collidingObject)
 Override this to define what happens when your playable character exits something.
virtual void TriggerEnter (GameObject collidingObject)
 Override this to define what happens when your playable character enters a trigger.
virtual void TriggerExit (GameObject collidingObject)
 Override this to define what happens when your playable character exits a trigger.

Protected Attributes

Vector3 _newMovement
Vector3 _jumpForce
SpriteRenderer _spriteRenderer
CircleCollider2D _circleCollider
Vector2 _detectGroundRaycastOrigin
Vector2 _groundPosition
bool _groundBelow = true
float _belowSlopeAngle
Vector3 _crossBelowSlopeAngle
Quaternion _newRotation
Vector3 _newPosition
GameObject[] _duplicates
Protected Attributes inherited from MoreMountains.InfiniteRunnerEngine.Jumper
bool _jumping = false
float _lastJumpTime
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 [get, protected set]
 the distance between the character and the ground
bool Invincible [get]

Member Function Documentation

◆ AngleCharacter()

virtual void MoreMountains.InfiniteRunnerEngine.HillRider.AngleCharacter ( )
protectedvirtual

◆ ApplyJumpForce()

override void MoreMountains.InfiniteRunnerEngine.HillRider.ApplyJumpForce ( )
protectedvirtual

◆ CharacterMovement()

virtual void MoreMountains.InfiniteRunnerEngine.HillRider.CharacterMovement ( )
protectedvirtual

◆ DetectGround()

virtual void MoreMountains.InfiniteRunnerEngine.HillRider.DetectGround ( )
protectedvirtual

◆ Die()

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

What happens when the object gets killed.

Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.

◆ FixedUpdate()

virtual void MoreMountains.InfiniteRunnerEngine.HillRider.FixedUpdate ( )
protectedvirtual

◆ Initialize()

override void MoreMountains.InfiniteRunnerEngine.HillRider.Initialize ( )
protectedvirtual

On awake, we handle initialization.

Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.

◆ Jump()

override void MoreMountains.InfiniteRunnerEngine.HillRider.Jump ( )
virtual

◆ LateUpdate()

virtual void MoreMountains.InfiniteRunnerEngine.HillRider.LateUpdate ( )
protectedvirtual

◆ PrepareJump()

virtual void MoreMountains.InfiniteRunnerEngine.HillRider.PrepareJump ( )
protectedvirtual

◆ RemainAboveGround()

virtual void MoreMountains.InfiniteRunnerEngine.HillRider.RemainAboveGround ( )
protectedvirtual

◆ SlopeBoost()

virtual void MoreMountains.InfiniteRunnerEngine.HillRider.SlopeBoost ( )
protectedvirtual

◆ Update()

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

On update we handle the animator's update.

Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.

◆ UpdateAllMecanimAnimators()

override void MoreMountains.InfiniteRunnerEngine.HillRider.UpdateAllMecanimAnimators ( )
protectedvirtual

Updates all mecanim animators.

Reimplemented from MoreMountains.InfiniteRunnerEngine.PlayableCharacter.

Member Data Documentation

◆ _belowSlopeAngle

float MoreMountains.InfiniteRunnerEngine.HillRider._belowSlopeAngle
protected

◆ _circleCollider

CircleCollider2D MoreMountains.InfiniteRunnerEngine.HillRider._circleCollider
protected

◆ _crossBelowSlopeAngle

Vector3 MoreMountains.InfiniteRunnerEngine.HillRider._crossBelowSlopeAngle
protected

◆ _detectGroundRaycastOrigin

Vector2 MoreMountains.InfiniteRunnerEngine.HillRider._detectGroundRaycastOrigin
protected

◆ _duplicates

GameObject [] MoreMountains.InfiniteRunnerEngine.HillRider._duplicates
protected

◆ _groundBelow

bool MoreMountains.InfiniteRunnerEngine.HillRider._groundBelow = true
protected

◆ _groundPosition

Vector2 MoreMountains.InfiniteRunnerEngine.HillRider._groundPosition
protected

◆ _jumpForce

Vector3 MoreMountains.InfiniteRunnerEngine.HillRider._jumpForce
protected

◆ _newMovement

Vector3 MoreMountains.InfiniteRunnerEngine.HillRider._newMovement
protected

◆ _newPosition

Vector3 MoreMountains.InfiniteRunnerEngine.HillRider._newPosition
protected

◆ _newRotation

Quaternion MoreMountains.InfiniteRunnerEngine.HillRider._newRotation
protected

◆ _spriteRenderer

SpriteRenderer MoreMountains.InfiniteRunnerEngine.HillRider._spriteRenderer
protected

◆ Acceleration

float MoreMountains.InfiniteRunnerEngine.HillRider.Acceleration = 100f

◆ CharacterRotationSpeed

float MoreMountains.InfiniteRunnerEngine.HillRider.CharacterRotationSpeed = 10f

◆ DustParticles

ParticleSystem MoreMountains.InfiniteRunnerEngine.HillRider.DustParticles

◆ Explosion

GameObject MoreMountains.InfiniteRunnerEngine.HillRider.Explosion

the explosion that happens when the dragon hits the ground

◆ GroundDetectionMaxY

float MoreMountains.InfiniteRunnerEngine.HillRider.GroundDetectionMaxY = 500000f

◆ MaximumAllowedAngle

float MoreMountains.InfiniteRunnerEngine.HillRider.MaximumAllowedAngle = 90f

◆ MaxSpeed

float MoreMountains.InfiniteRunnerEngine.HillRider.MaxSpeed = 8f

◆ MinimumAllowedAngle

float MoreMountains.InfiniteRunnerEngine.HillRider.MinimumAllowedAngle = -90f

◆ ModelContainer

GameObject MoreMountains.InfiniteRunnerEngine.HillRider.ModelContainer

◆ RaycastLength

float MoreMountains.InfiniteRunnerEngine.HillRider.RaycastLength = 1000000f

◆ ResetAngleInTheAir

bool MoreMountains.InfiniteRunnerEngine.HillRider.ResetAngleInTheAir = true

The documentation for this class was generated from the following file:
  • Assets/InfiniteRunnerEngine/Demos/Downhill/Scripts/HillRider.cs