Add this class to a 2D agent (player, enemy, item) and it'll "cast" a shadow on a collider
More...
|
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...
|
|
Add this class to a 2D agent (player, enemy, item) and it'll "cast" a shadow on a collider
◆ 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
◆ _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:
- Assets/InfiniteRunnerEngine/Common/Scripts/Decoration/Shadow.cs