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

Add this class to a 2D agent (player, enemy, item) and it'll "cast" a shadow on a collider More...

Inheritance diagram for MoreMountains.InfiniteRunnerEngine.Shadow:

Public Attributes

GameObject ShadowPrefab
 The prefab to instantiate as the object's shadow. More...
 
LayerMask GroundMask = 0
 The collision mask to use to place the shadow. More...
 
float _rayLength = 10f
 The length of the raycast used to detect the ground. More...
 
Vector3 ShadowOffset = new Vector3(0f,0f,0f)
 the offset that is always applied to the shadow (use this to adjust the shadow to your character and compensate for ground height, centering etc) More...
 
float MaximumVerticalDistance = 10f
 The maximum vertical distance considered for the shadow (when the shadow's owner reaches that distance to the ground, the shadow's scale is minimal. More...
 
float ShadowMaxHorizontalDistance = -3f
 The maximum horizontal offset to apply to the shadow when far away. More...
 

Protected Member Functions

virtual void Start ()
 Triggered at instanciation More...
 
virtual void Initialize ()
 Creates the initial shadow More...
 
virtual void Update ()
 Updates the shadow's size and position at every frame More...
 

Protected Attributes

GameObject _shadow
 
BoxCollider2D _boxCollider
 
RaycastHit2D _hit
 
Vector3 _initialScale
 
Vector3 _shadowOffsetBasedOnHeight = new Vector3(0,0,0)
 

Detailed Description

Add this class to a 2D agent (player, enemy, item) and it'll "cast" a shadow on a collider

Member Function Documentation

◆ Initialize()

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

Creates the initial shadow

◆ Start()

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

Triggered at instanciation

◆ Update()

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

Updates the shadow's size and position at every frame

Member Data Documentation

◆ _boxCollider

BoxCollider2D MoreMountains.InfiniteRunnerEngine.Shadow._boxCollider
protected

◆ _hit

RaycastHit2D MoreMountains.InfiniteRunnerEngine.Shadow._hit
protected

◆ _initialScale

Vector3 MoreMountains.InfiniteRunnerEngine.Shadow._initialScale
protected

◆ _rayLength

float MoreMountains.InfiniteRunnerEngine.Shadow._rayLength = 10f

The length of the raycast used to detect the ground.

◆ _shadow

GameObject MoreMountains.InfiniteRunnerEngine.Shadow._shadow
protected

◆ _shadowOffsetBasedOnHeight

Vector3 MoreMountains.InfiniteRunnerEngine.Shadow._shadowOffsetBasedOnHeight = new Vector3(0,0,0)
protected

◆ GroundMask

LayerMask MoreMountains.InfiniteRunnerEngine.Shadow.GroundMask = 0

The collision mask to use to place the shadow.

◆ MaximumVerticalDistance

float MoreMountains.InfiniteRunnerEngine.Shadow.MaximumVerticalDistance = 10f

The maximum vertical distance considered for the shadow (when the shadow's owner reaches that distance to the ground, the shadow's scale is minimal.

◆ ShadowMaxHorizontalDistance

float MoreMountains.InfiniteRunnerEngine.Shadow.ShadowMaxHorizontalDistance = -3f

The maximum horizontal offset to apply to the shadow when far away.

◆ ShadowOffset

Vector3 MoreMountains.InfiniteRunnerEngine.Shadow.ShadowOffset = new Vector3(0f,0f,0f)

the offset that is always applied to the shadow (use this to adjust the shadow to your character and compensate for ground height, centering etc)

◆ ShadowPrefab

GameObject MoreMountains.InfiniteRunnerEngine.Shadow.ShadowPrefab

The prefab to instantiate as the object's shadow.


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