Class CharacterRenderer2D
Controls the character rendering for Sprites. This includes automatic animator set up and
also includes systems tinting the sprite for vfx.
Inheritance
System.Object
CharacterRenderer2D
Assembly: cs.temp.dll.dll
Syntax
public class CharacterRenderer2D : MonoBehaviour
Fields
_controllerBody2D
Declaration
protected ControllerBody2D _controllerBody2D
Field Value
_forcedStateHash
Declaration
protected int _forcedStateHash
Field Value
| Type |
Description |
| System.Int32 |
|
_lastAnimationHash
Declaration
protected int _lastAnimationHash
Field Value
| Type |
Description |
| System.Int32 |
|
_runtimeAnimator
The runtime animator for Animator.
This is used to update animation clips at runtime for forced states.
Declaration
protected RuntimeAnimatorController _runtimeAnimator
Field Value
| Type |
Description |
| RuntimeAnimatorController |
|
_spriteRend
Declaration
protected SpriteRenderer _spriteRend
Field Value
| Type |
Description |
| SpriteRenderer |
|
Animator
Declaration
Field Value
| Type |
Description |
| Animator |
|
AnimatorParameters
Declaration
public AnimatorControllerParameter[] AnimatorParameters
Field Value
| Type |
Description |
| AnimatorControllerParameter[] |
|
CanTurnAround
Declaration
public bool CanTurnAround
Field Value
| Type |
Description |
| System.Boolean |
|
CharacterType
Declaration
public CharacterTypes CharacterType
Field Value
DeathAnimationHash
Declaration
protected static readonly int DeathAnimationHash
Field Value
| Type |
Description |
| System.Int32 |
|
IsFallingAnimationHash
Declaration
protected static readonly int IsFallingAnimationHash
Field Value
| Type |
Description |
| System.Int32 |
|
IsGroundedAnimationHash
Declaration
protected static readonly int IsGroundedAnimationHash
Field Value
| Type |
Description |
| System.Int32 |
|
IsJumpingAnimationHash
Declaration
protected static readonly int IsJumpingAnimationHash
Field Value
| Type |
Description |
| System.Int32 |
|
StartedFacingRight
Declaration
public bool StartedFacingRight
Field Value
| Type |
Description |
| System.Boolean |
|
UseAnimatorTransitions
Declaration
public bool UseAnimatorTransitions
Field Value
| Type |
Description |
| System.Boolean |
|
XSpeedAnimationHash
Declaration
protected static readonly int XSpeedAnimationHash
Field Value
| Type |
Description |
| System.Int32 |
|
Properties
CharacterState
Declaration
public CharacterState CharacterState { get; }
Property Value
MovementAnimationHash
Declaration
protected int MovementAnimationHash { get; }
Property Value
| Type |
Description |
| System.Int32 |
|
Methods
Init()
Declaration
LateUpdate()
Declaration
protected void LateUpdate()
OnAttackStateChanged(AttackState)
Declaration
protected void OnAttackStateChanged(AttackState attackState)
Parameters
OnDirectionChanged(Object, Vector2)
Declaration
protected void OnDirectionChanged(object sender, Vector2 direction)
Parameters
| Type |
Name |
Description |
| System.Object |
sender |
|
| Vector2 |
direction |
|
OnInit()
Declaration
protected virtual void OnInit()
SetAnimationState(String, Single)
Declaration
public void SetAnimationState(string stateName, float animationFadeTime = 0.01F)
Parameters
| Type |
Name |
Description |
| System.String |
stateName |
|
| System.Single |
animationFadeTime |
|
SpriteFlip(Vector2)
Declaration
protected void SpriteFlip(Vector2 direction)
Parameters
| Type |
Name |
Description |
| Vector2 |
direction |
|
UpdateAnimatorParameters()
Declaration
protected virtual void UpdateAnimatorParameters()