Exemplo n.º 1
0
        private bool _initSupportTorpedoPhase2(object data)
        {
            BattleField   battleField   = BattleTaskManager.GetBattleField();
            BattleCameras battleCameras = BattleTaskManager.GetBattleCameras();

            battleCameras.friendFieldCamera.ReqViewMode(CameraActor.ViewMode.NotViewModeCtrl);
            Vector3 position = battleField.dicCameraAnchors[CameraAnchorType.OneRowAnchor][FleetType.Friend].position;

            battleCameras.friendFieldCamera.transform.position      = new Vector3(-38f, 8f, -74f);
            battleCameras.friendFieldCamera.transform.localRotation = Quaternion.Euler(new Vector3(9.5f, 137.5f, 0f));
            BattleTaskManager.GetBattleShips().SetBollboardTarget(isFriend: false, battleCameras.friendFieldCamera.transform);
            if (_prodSupportTorpedoP1 != null)
            {
                _prodSupportTorpedoP1.deleteTorpedoWake();
                _prodSupportTorpedoP1.OnSetDestroy();
            }
            _prodSupportTorpedoP1 = null;
            _prodSupportTorpedoP2.Play(_onSupportTorpedoPhase2Finished);
            return(false);
        }
Exemplo n.º 2
0
        private IEnumerator CreateTorpedo1(IObserver <bool> observer)
        {
            Transform torpedoStraight = Object.Instantiate(BattleTaskManager.GetPrefabFile().prefabTorpedoStraightController, Vector3.zero, Quaternion.identity) as Transform;
            Transform trams3          = new GameObject().transform;

            trams3.name           = "ProdSupportTorpedoPhase1";
            _prodSupportTorpedoP1 = new ProdSupportTorpedoP1(trams3, ((Component)torpedoStraight).GetComponent <TorpedoStraightController>());
            _prodSupportTorpedoP1.Initialize(_clsTorpedo, TorpedoParticle);
            yield return(new WaitForEndOfFrame());

            Transform trams2 = new GameObject().transform;

            trams2.name           = "ProdSupportTorpedoPhase2";
            _prodSupportTorpedoP2 = new ProdSupportTorpedoP2(trams2);
            _prodSupportTorpedoP2.Initialize(_clsTorpedo, TorpedoParticle);
            yield return(new WaitForEndOfFrame());

            _prodSupportTorpedoP2.CreateHpGauge(FleetType.Enemy);
            yield return(new WaitForEndOfFrame());

            observer.OnNext(value: true);
            observer.OnCompleted();
        }
Exemplo n.º 3
0
 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);
 }