public void ShootBolt1_Stop() { ifStopBolt1 = true; foreach (GameObject shotObj in shotObjs_Bolt1) { if (!shotObj.activeSelf) { break; } else { Bolt1_SubBossShootCross crossBoltObj = new Bolt1_SubBossShootCross(); RotateAndShootTest rotateBoltObj = new RotateAndShootTest(); Bolt1_SubBoltMoveToStart subBoltMove = new Bolt1_SubBoltMoveToStart(); if ((crossBoltObj = shotObj.GetComponent <Bolt1_SubBossShootCross>()) != null) { crossBoltObj.StopShooting(); } if ((rotateBoltObj = shotObj.GetComponentInChildren <RotateAndShootTest>()) != null) { rotateBoltObj.ifCanShoot = false; } if ((subBoltMove = shotObj.GetComponent <Bolt1_SubBoltMoveToStart>()) != null) { shotObj.GetComponent <Bolt1_SubBoltMoveToStart>().HideAndDestroy(); } } } }
public void ShootBolt1_Start() { ifStopBolt1 = false; foreach (GameObject shotObj in shotObjs_Bolt1) { if (shotObj.activeSelf && shotObj != shotObjs_Bolt1[0]) { break; } else { shotObj.SetActive(true); Bolt1_SubBossShootCross crossBoltObj = new Bolt1_SubBossShootCross(); Bolt1_SubBoltMoveToStart subBoltMove = new Bolt1_SubBoltMoveToStart(); RotateAndShootTest rotateObj = new RotateAndShootTest(); if ((crossBoltObj = shotObj.GetComponent <Bolt1_SubBossShootCross>()) != null) { crossBoltObj.StartShooting(); } if ((subBoltMove = shotObj.GetComponent <Bolt1_SubBoltMoveToStart>()) != null) { shotObj.GetComponent <Bolt1_SubBoltMoveToStart>().MoveToStartPos(); } if ((rotateObj = shotObj.GetComponentInChildren <RotateAndShootTest>()) != null) { rotateObj.ifCanShoot = true; } } } }
// 子弹 1-2 void ShootBolt_1_RotateAround() { foreach (GameObject mouthShotSpawn in mouthShotSpawns) { if (mouthShotSpawn.GetComponent <RotateAndShootTest>() == null) { // 圆周运动的散射子弹(口腔处) RotateAndShootTest rotate = mouthShotSpawn.AddComponent <RotateAndShootTest>() as RotateAndShootTest; rotate.rotateRate = this.rotateRate_Bolt1; rotate.shootRate = this.shootRate_Bolt1; rotate.rotateAround = mouthShotSpawn.transform; rotate.shotSpawn = mouthShotSpawn.transform; rotate.bolt = this.bolt2_Prefab; rotate.ifCanShoot = true; } else { mouthShotSpawn.GetComponent <RotateAndShootTest>().ifCanShoot = true; } } }
// 子弹2 IEnumerator ShootBolt_2_RotateAround() { // 圆周运动的散射子弹(SL、SR、LL、LR 4根钳内部) foreach (GameObject shotSpawn in shotSpawnsForBolt_2) { if (shotSpawn.GetComponent <RotateAndShootTest>() == null) { RotateAndShootTest rotate = shotSpawn.AddComponent <RotateAndShootTest>() as RotateAndShootTest; rotate.rotateRate = this.rotateRate_Bolt2; rotate.shootRate = this.shootRate_Bolt2; rotate.rotateAround = shotSpawn.transform; rotate.shotSpawn = shotSpawn.transform; rotate.bolt = this.bolt2_Prefab; rotate.ifCanShoot = true; yield return(new WaitForSeconds(shotSpawnDelay)); } else { shotSpawn.GetComponent <RotateAndShootTest>().ifCanShoot = true; } } }