Example #1
0
 void Awake()
 {
     // Set up the references.
     // _deathSound = GetComponent<SoundPlayOneshot>();
     _appear = GetComponent <AppearScript>();
     nav     = GetComponent <UnityEngine.AI.NavMeshAgent>();
 }
Example #2
0
        private void Reset()
        {
            MainRigidbody  = GetComponent <Rigidbody>();
            AllRigidBodies = GetComponentsInChildren <Rigidbody>().ToList();
            Colliders      = GetComponentsInChildren <Collider>().ToList();
            Animator       = GetComponent <Animator>();
            AppearScript   = GetComponent <AppearScript>();

            if (MainRigidbody == null)
            {
                Debug.LogError("Reset of " + name + "'s " + GetType() + ": No Rigidbody found");
            }
            if (Animator == null)
            {
                Debug.LogError("Reset of " + name + "'s " + GetType() + ": No Animator found");
            }
            if (Colliders == null || Colliders.Count == 0)
            {
                Debug.LogError("Reset of " + name + "'s " + GetType() + ": No Colliders found");
            }
        }