void Awake() { anyRPGCharacterController = GetComponent <AnyRPGCharacterController>(); characterUnit = GetComponent <CharacterUnit>(); //Set currentState to idle on startup. currentState = AnyRPGCharacterState.Idle; rpgCharacterState = AnyRPGCharacterState.Idle; airForwardDirection = transform.forward; }
public void GetComponentReferences() { anyRPGCharacterController = GetComponent <AnyRPGCharacterController>(); if (anyRPGCharacterController == null) { //Debug.Log(gameObject.name + ".PlayerUnitMovementController.GetComponentReferences(): unable to get AnyRPGCharacterController"); } if (characterUnit == null) { characterUnit = GetComponent <CharacterUnit>(); if (characterUnit == null) { //Debug.Log(gameObject.name + ".PlayerUnitMovementController.GetComponentReferences(): unable to get characterUnit"); } } animatedUnit = GetComponent <AnimatedUnit>(); if (animatedUnit == null) { //Debug.Log(gameObject.name + ".PlayerUnitMovementController.GetComponentReferences(): unable to get animatedUnit"); } }