Пример #1
0
 private void Awake()
 {
     rpgCharacterController = GetComponent <RPGCharacterControllerFREE>();
     //Find the Animator component.
     animator = GetComponentInChildren <Animator>();
     StartCoroutine(_HideAllWeapons(false, false));
 }
Пример #2
0
        private void Start()
        {
            //Get other RPG Character components.
            superCharacterController    = GetComponent <SuperCharacterController>();
            rpgCharacterController      = GetComponent <RPGCharacterControllerFREE>();
            rpgCharacterInputController = GetComponent <RPGCharacterInputControllerFREE>();
            navMeshAgent = GetComponent <UnityEngine.AI.NavMeshAgent>();

            //Check if Animator exists, otherwise pause script.
            animator = GetComponentInChildren <Animator>();
            if (animator == null)
            {
                Destroy(this);
                return;
            }

            //Setup Collider and Rigidbody for collisions.
            capCollider = GetComponent <CapsuleCollider>();
            rb          = GetComponent <Rigidbody>();
            if (rb != null)
            {
                //Set restraints on startup if using Rigidbody.
                rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;
            }

            SwitchCollisionOn();

            //Set currentState to idle on startup.
            currentState      = RPGCharacterState.Idle;
            rpgCharacterState = RPGCharacterState.Idle;
        }
Пример #3
0
        private void Start()
        {
            rpgCharacterController         = GetComponent <RPGCharacterControllerFREE>();
            rpgCharacterMovementController = GetComponent <RPGCharacterMovementControllerFREE>();
            rpgCharacterWeaponController   = GetComponent <RPGCharacterWeaponControllerFREE>();

            //Check if Animator exists, otherwise pause script.
            if (rpgCharacterController.animator == null)
            {
                Destroy(this);
                return;
            }
        }
 private void Awake()
 {
     superCharacterController    = GetComponent <SuperCharacterController>();
     rpgCharacterController      = GetComponent <RPGCharacterControllerFREE>();
     rpgCharacterInputController = GetComponent <RPGCharacterInputControllerFREE>();
     navMeshAgent = GetComponent <UnityEngine.AI.NavMeshAgent>();
     animator     = GetComponentInChildren <Animator>();
     capCollider  = GetComponent <CapsuleCollider>();
     rb           = GetComponent <Rigidbody>();
     if (rb != null)
     {
         //Set restraints on startup if using Rigidbody.
         rb.constraints = RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationZ;
     }
     //Set currentState to idle on startup.
     currentState      = RPGCharacterState.Idle;
     rpgCharacterState = RPGCharacterState.Idle;
 }
 private void Awake()
 {
     rpgCharacterController         = GetComponent <RPGCharacterControllerFREE>();
     rpgCharacterMovementController = GetComponent <RPGCharacterMovementControllerFREE>();
     rpgCharacterWeaponController   = GetComponent <RPGCharacterWeaponControllerFREE>();
 }