private IEnumerator CreateAerialCombatCutIn(IObserver <bool> observer) { BattleCameras cams = BattleTaskManager.GetBattleCameras(); BattleCutInCamera inCam = BattleTaskManager.GetBattleCameras().cutInCamera; BattleCutInEffectCamera efCam = BattleTaskManager.GetBattleCameras().cutInEffectCamera; BattleShips _battleShips = BattleTaskManager.GetBattleShips(); _prodSupportAerialPhase1 = ProdSupportAerialPhase1.Instantiate(fShips: _battleShips.dicFriendBattleShips, eShips: _battleShips.dicEnemyBattleShips, prefab: Resources.Load <ProdSupportAerialPhase1>("Prefabs/Battle/Production/SupportingFire/ProdSupportAerialPhase1"), model: _clsAerial, parent: cams.cutInCamera.transform.parent); if (_clsAerial.GetPlanes(is_friend: true) != null && _clsAerial.GetPlanes(is_friend: false) != null) { inCam.isCulling = true; efCam.isCulling = true; } else if (_clsAerial.GetPlanes(is_friend: true) != null) { efCam.isCulling = false; } yield return(new WaitForEndOfFrame()); _prodSupportAerialPhase2 = ProdSupportAerialPhase2.Instantiate(Resources.Load <ProdSupportAerialPhase2>("Prefabs/Battle/Production/SupportingFire/ProdSupportAerialPhase2"), _clsAerial, inCam.transform); yield return(new WaitForEndOfFrame()); _prodSupportAerialPhase2.CreateHpGauge(FleetType.Enemy); yield return(new WaitForEndOfFrame()); observer.OnNext(value: true); observer.OnCompleted(); }
protected override bool UnInit() { _clsShien = null; _clsState.Clear(); if (_prodSupportCutIn != null) { _prodSupportCutIn.gameObject.Discard(); } _prodSupportCutIn = null; if (_prodSupportShelling != null) { _prodSupportShelling.gameObject.Discard(); } _prodSupportShelling = null; if (_prodSupportTorpedoP1 != null && _prodSupportTorpedoP1.transform != null) { Object.Destroy(_prodSupportTorpedoP1.transform.gameObject); } _prodSupportTorpedoP1 = null; if (_prodSupportTorpedoP2 != null && _prodSupportTorpedoP2.transform != null) { Object.Destroy(_prodSupportTorpedoP2.transform.gameObject); } _prodSupportTorpedoP2 = null; if (_prodSupportAerialPhase1 != null) { _prodSupportAerialPhase1.gameObject.Discard(); } _prodSupportAerialPhase1 = null; if (_prodSupportAerialPhase2 != null) { _prodSupportAerialPhase2.gameObject.Discard(); } _prodSupportAerialPhase2 = null; return(true); }