void Awake()
        {
            anyRPGCharacterController = GetComponent <AnyRPGCharacterController>();
            characterUnit             = GetComponent <CharacterUnit>();

            //Set currentState to idle on startup.
            currentState        = AnyRPGCharacterState.Idle;
            rpgCharacterState   = AnyRPGCharacterState.Idle;
            airForwardDirection = transform.forward;
        }
Beispiel #2
0
 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");
     }
 }