示例#1
0
 protected virtual void Start()
 {
     enemyMechs        = gameObject.GetComponentInParent <EnemyMechs>();
     shooter           = transform.root.gameObject;
     selfTakeDamage    = gameObject.GetComponentInParent <TakeDamage>();
     threatScript      = gameObject.GetComponentInParent <ThreatScript>();
     aimingScript      = transform.root.Find("hips/Torso/AimPoint").GetComponent <EnemyAiming>();
     weaponAudioSource = gameObject.GetComponent <AudioSource>();
 }
示例#2
0
        void Start()
        {
            takeDamage   = gameObject.GetComponent <TakeDamage>();
            threatScript = gameObject.GetComponent <ThreatScript>();
            navAgent     = gameObject.GetComponent <NavMeshAgent>();
            torso        = transform.Find("hips/Torso");
            targets      = threatScript.targets.Where(i => i != null && i != this.gameObject).ToArray();

            // Patrol();
        }