コード例 #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>();
            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;
        }
コード例 #2
0
 private void Awake()
 {
     //Setup Animator, add AnimationEvents script.
     animator = GetComponentInChildren <Animator>();
     if (animator == null)
     {
         Debug.LogError("ERROR: There is no Animator component for character.");
         Destroy(this);
     }
     else
     {
         animator.gameObject.AddComponent <RPGCharacterAnimatorEvents>();
         animator.GetComponent <RPGCharacterAnimatorEvents>().rpgCharacterController = this;
     }
     rpgCharacterMovementController = GetComponent <RPGCharacterMovementController>();
     rpgCharacterWeaponController   = GetComponent <RPGCharacterWeaponController>();
     rpgCharacterInputController    = GetComponent <RPGCharacterInputController>();
     //Find HeadLookController if applied.
     headLookController = GetComponent <PerfectLookAt>();
     ikHands            = GetComponent <IKHands>();
     //Set for starting Unarmed state.
     weapon = Weapon.UNARMED;
     animator.SetInteger("Weapon", 0);
     animator.SetInteger("WeaponSwitch", -1);
     StartCoroutine(_ResetIdleTimer());
     //Turn off headlook in editor.
                 #if UNITY_EDITOR
     headLook = false;
                 #endif
     isHeadlook = headLook;
 }
コード例 #3
0
 private void Awake()
 {
     rpgCharacterController         = GetComponent <RPGCharacterController>();
     rpgCharacterMovementController = GetComponent <RPGCharacterMovementController>();
     rpgCharacterWeaponController   = GetComponent <RPGCharacterWeaponController>();
 }
コード例 #4
0
 private void Start()
 {
     // Get other RPG Character components.
     rpgCharacterController       = GetComponent <RPGCharacterController>();
     rpgCharacterWeaponController = GetComponent <RPGCharacterWeaponController>();
 }
コード例 #5
0
ファイル: IKHands.cs プロジェクト: sonnybuhos/PIRATES
 private void Awake()
 {
     animator = GetComponent <Animator>();
     rpgCharacterWeaponController = GetComponent <RPGCharacterWeaponController>();
 }