/* 子弹3操作 */ // 开始发射:子弹3 public void ShootBolt3_Start() { // 钳子开始挥舞 foreach (GameObject wavePincer in wavePincers_Bolt4) { wavePincer.GetComponent <RotateAround>().enabled = true; } // 开启子弹功能 foreach (GameObject shotSpawn in shotSpawnsForBolt_3) { // 若是第一次开启,则需要对每个发射口添加发射脚本 if (shotSpawn.GetComponent <ShotBolt1>() == null) { ShotBolt1 shotBolt1 = shotSpawn.AddComponent <ShotBolt1>() as ShotBolt1; shotBolt1.bolt_1_Prefab = bolt2_Prefab; shotBolt1.boltDelay = boltDelay; shotBolt1.shotSpawn = shotSpawn.transform; } // 若不是第一次开启,说明各发射口已有发射脚本,无需重复添加,仅需打开发射开关即可 else { shotSpawn.GetComponent <ShotBolt1>().ifCanShoot = true; } } // 开启触手功能 tentacle_Obj = Instantiate(tentacle, tentacle.transform.position, tentacle.transform.rotation) as GameObject; }
// 子弹 1-1 void ShootBolt_1_StraightBolt() { // 往返运动的直射子弹(6根钳尾处) foreach (GameObject shotSpawn in shotSpawnsForBolt_1) { if (shotSpawn.GetComponent <ShotBolt1>() == null) { ShotBolt1 shotBolt1 = shotSpawn.AddComponent <ShotBolt1>() as ShotBolt1; shotBolt1.bolt_1_Prefab = bolt1_Prefab; shotBolt1.boltDelay = boltDelay; shotBolt1.shotSpawn = shotSpawn.transform; } else { shotSpawn.GetComponent <ShotBolt1>().ifCanShoot = true; } } }