Beispiel #1
0
        private void SetCameraTarget(Transform t)
        {
            target = t;

            if (target != null)
            {
                if (target.GetComponent <CharacterControl>())
                {
                    charController = target.GetComponent <CharacterControl>();
                }
                else
                {
                    Debug.LogError("Target is missing a CharacterControl");
                }
            }
            else
            {
                Debug.LogError("Your camera needs a target.");
            }
        }
Beispiel #2
0
        public override void UpdateAbility(CharacterState characterState, Animator animator, AnimatorStateInfo stateInfo)
        {
            CharacterControl cc = characterState.GetCharacterControl(animator);

            //if (VirtualInputManager.Instance.movement.magnitude > 0)
            //{
            //    animator.SetBool(TransitionParameter.isMove.ToString(), true);
            //}
            if (cc.GetComponent <ManualInput>().input.magnitude > 0)
            {
                animator.SetBool(TransitionParameter.isMove.ToString(), true);
            }
            if (cc.jump)
            {
                animator.SetBool(TransitionParameter.jump.ToString(), true);
            }
            if (cc.attack)
            {
                animator.SetBool(TransitionParameter.attack.ToString(), true);
            }
        }
Beispiel #3
0
 private void Awake()
 {
     cc = this.gameObject.GetComponent <CharacterControl>();
 }