示例#1
0
        private void Awake()
        {
            rpgCharacterMovementController = GetComponent <RPGCharacterMovementController>();
            rpgCharacterWeaponController   = GetComponent <RPGCharacterWeaponController>();
            rpgCharacterInputController    = GetComponent <RPGCharacterInputController>();
            animator = GetComponentInChildren <Animator>();
            if (animator == null)
            {
                Debug.LogError("ERROR: There is no animator for character.");
                Destroy(this);
            }
            //Find HeadLookController if applied.
            headLookController = GetComponent <PerfectLookAt.PerfectLookAt>();
            ikHands            = GetComponent <IKHands>();
            //Set for starting Relax state.
            weapon = Weapon.RELAX;
            animator.SetInteger("Weapon", -1);
            animator.SetInteger("WeaponSwitch", -1);
            StartCoroutine(_ResetIdleTimer());
            //Turn off headlook in editor.
#if UNITY_EDITOR
            headLook = false;
#endif
            isHeadlook = headLook;
        }
 private void Awake()
 {
     rpgCharacterController         = GetComponent <RPGCharacterController>();
     rpgCharacterMovementController = GetComponent <RPGCharacterMovementController>();
     rpgCharacterWeaponController   = GetComponent <RPGCharacterWeaponController>();
 }