示例#1
0
 protected override void Start()
 {
     //overrides start function of enemy.cs
     base.Start ();
     try {
         gun = transform.Find ("enemyGun").GetComponent<EnemyGun>();
     } catch {
         //Debug.Log ("No 'enemyGun' found, looking for shotgun");
         try {
             shotgun = transform.Find ("enemyShotgun").GetComponent<EnemyShotgun>();
         } catch {
             //Debug.Log ("No 'enemyShotgun' found, looking for launcher");
             try {
                 launcher = transform.Find ("missilePoint").GetComponent<EnemyLauncher>();
             } catch {
                 //Debug.Log ("No 'enemyLauncher' found, looking for lobber");
                 try {
                     lobber = transform.Find ("lobPoint").GetComponent<EnemyLobber>();
                 } catch {
                     Debug.Log ("No gun attached to a shooting enemy");
                 }
             }
         }
     }
 }
示例#2
0
 override protected void Start()         //overrides start function of enemy.cs
 {
     base.Start();
     try {
         gun = transform.Find("enemyGun").GetComponent <EnemyGun>();
     } catch {
         //Debug.Log ("No 'enemyGun' found, looking for shotgun");
         try {
             shotgun = transform.Find("enemyShotgun").GetComponent <EnemyShotgun>();
         } catch {
             Debug.Log("No gun attached to a shooting enemy");
         }
     }
 }