Exemple #1
0
        private void _onTorpedoExplosionFinished()
        {
            BattleCutInEffectCamera efcam         = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            UICircleHPGauge         circleHPGauge = BattleTaskManager.GetPrefabFile().circleHPGauge;

            circleHPGauge.transform.localScaleZero();
            PlayProdDamage(_clsRaigeki, delegate
            {
                efcam.isCulling = true;
                Observable.Timer(TimeSpan.FromSeconds(1.0)).Subscribe(delegate
                {
                    ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                    observerAction.Register(delegate
                    {
                        BattleTaskManager.GetTorpedoHpGauges().Hide();
                    });
                    EndPhase(BattleUtils.NextPhase(BattlePhase.OpeningTorpedoSalvo));
                });
            });
            if (_prodTorpedoSalvoPhase3 != null)
            {
                UnityEngine.Object.Destroy(_prodTorpedoSalvoPhase3.transform.gameObject);
            }
            _prodTorpedoSalvoPhase3 = null;
        }
Exemple #2
0
        protected virtual void PlayHpGaugeDamage(UIBattleShip ship, HitState iState)
        {
            BattleHitStatus status = BattleHitStatus.Normal;

            switch (iState)
            {
            case HitState.Miss:
                status = BattleHitStatus.Miss;
                break;

            case HitState.CriticalDamage:
                status = BattleHitStatus.Clitical;
                break;
            }
            if (this._clsHougekiModel != null)
            {
                UICircleHPGauge circleHPGauge = BattleTaskManager.GetPrefabFile().circleHPGauge;
                circleHPGauge.SetHPGauge(this._clsHougekiModel.Defender.MaxHp, this._clsHougekiModel.Defender.HpBefore, this._clsHougekiModel.Defender.HpAfter, this._clsHougekiModel.GetDamage(), status, this._clsHougekiModel.Defender.IsFriend());
                Vector3 damagePosition = (!this._clsHougekiModel.Defender.IsFriend()) ? new Vector3(280f, -125f, 0f) : new Vector3(-500f, -125f, 0f);
                circleHPGauge.SetDamagePosition(damagePosition);
                circleHPGauge.Play(delegate
                {
                });
            }
        }
 private void OnTorpedoTerminate()
 {
     _clsState.Clear();
     PlayProdDamage(_clsNowRaigeki, delegate
     {
         UICircleHPGauge circleHPGauge = BattleTaskManager.GetPrefabFile().circleHPGauge;
         circleHPGauge.transform.localScaleZero();
         Mem.DelIDisposableSafe(ref _prodShellingTorpedo);
         Dlg.Call(ref _actOnFleetAction);
     });
 }
 public void PlayHpAll(Action callBack)
 {
     using (List <UICircleHPGauge> .Enumerator enumerator = this._listHpGauge.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             UICircleHPGauge current = enumerator.get_Current();
             if (current != null)
             {
                 current.Plays(callBack);
             }
         }
     }
 }
 public void ShowAll(Vector3 scale, bool isScale)
 {
     using (List <UICircleHPGauge> .Enumerator enumerator = this._listHpGauge.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             UICircleHPGauge current = enumerator.get_Current();
             if (current != null)
             {
                 current.SetTextureScale(scale, isScale);
             }
         }
     }
 }
 public bool Init()
 {
     using (List <UICircleHPGauge> .Enumerator enumerator = this._listHpGauge.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             UICircleHPGauge current = enumerator.get_Current();
             if (current != null)
             {
                 current.get_transform().set_localScale(Vector3.get_zero());
             }
         }
     }
     return(true);
 }
Exemple #7
0
        private new void Start()
        {
            InitBattleData();
            _clsSettingModel   = new SettingModel();
            _iPhase            = (_iPhaseReq = BattlePhase.BattlePhase_BEF);
            _traStage          = base.transform.FindChild("Stage");
            _clsBattleShips    = new BattleShips();
            _clsBattleCameras  = new BattleCameras();
            _clsBattleHPGauges = new BattleHPGauges();
            _clsBattleField    = base.transform.GetComponentInChildren <BattleField>();
            UICircleHPGauge    circleHPGauge    = _clsBattlePrefabFile.circleHPGauge;
            UIBattleNavigation battleNavigation = _clsBattlePrefabFile.battleNavigation;

            battleNavigation.panel.depth = 100;
            _clsTorpedoHpGauges          = new TorpedoHpGauges();
            _clsBattleShips.Init(GetBattleManager());
            _clsBattleField.ReqTimeZone(GetStartTimeZone(GetBattleManager().WarType), GetSkyType());
            KCV.Utils.SoundUtils.SwitchBGM((BGMFileInfos)GetBattleManager().GetBgmId());
            ProdSortieTransitionToBattle psttb = (SortieBattleTaskManager.GetSortieBattlePrefabFile() != null) ? SortieBattleTaskManager.GetSortieBattlePrefabFile().prodSortieTransitionToBattle : ProdSortieTransitionToBattle.Instantiate(Resources.Load <ProdSortieTransitionToBattle>("Prefabs/SortieMap/SortieTransitionToBattle/ProdSortieTransitionToBattle"), _clsBattleCameras.cutInCamera.transform).QuickFadeInInit();

            Observable.FromCoroutine((UniRx.IObserver <float> observer) => InitBattle(observer)).Subscribe(delegate(float x)
            {
                if (x == 1f)
                {
                    _iPhase = (_iPhaseReq = BattlePhase.FleetAdvent);
                    Observable.Timer(TimeSpan.FromSeconds(0.30000001192092896)).Subscribe(delegate
                    {
                        _clsBattleField.AlterWaveDirection(FleetType.Friend);
                        psttb.Play(ProdSortieTransitionToBattle.AnimationName.ProdSortieTransitionToBattleFadeIn, delegate
                        {
                            if (SortieBattleTaskManager.GetSortieBattlePrefabFile() != null)
                            {
                                SortieBattleTaskManager.GetSortieBattlePrefabFile().DisposeProdSortieTransitionToBattle();
                            }
                            else
                            {
                                UnityEngine.Object.Destroy(psttb.gameObject);
                            }
                            if (SortieBattleTaskManager.GetTransitionCamera() != null)
                            {
                                SortieBattleTaskManager.GetTransitionCamera().enabled = false;
                            }
                            Mem.Del(ref psttb);
                        });
                    });
                }
            }).AddTo(base.gameObject);
        }
        private UICircleHPGauge _instantiate(GameObject obj, bool isFriend, bool isLight, bool isT, bool isNumber)
        {
            if (this._hpGauge == null)
            {
                this._hpGauge = Resources.Load <UICircleHPGauge>("Prefabs/Battle/UI/UICircleHPGaugeS");
            }
            UICircleHPGauge component = Util.Instantiate(this._hpGauge.get_gameObject(), obj, false, false).GetComponent <UICircleHPGauge>();

            component.set_name((!isFriend) ? ("HpGaugeE" + this._listHpGauge.get_Count()) : ("HpGaugeF" + this._listHpGauge.get_Count()));
            component.SetTextureType(isLight);
            if (isNumber)
            {
                component.SetShipNumber(this._listHpGauge.get_Count() + 1, isFriend, isT);
            }
            return(component);
        }
Exemple #9
0
        private UICircleHPGauge _instantiate(GameObject obj, bool isFriend, bool isLight, bool isT, bool isNumber)
        {
            if (_hpGauge == null)
            {
                _hpGauge = Resources.Load <UICircleHPGauge>("Prefabs/Battle/UI/UICircleHPGaugeS");
            }
            UICircleHPGauge component = Util.Instantiate(_hpGauge.gameObject, obj).GetComponent <UICircleHPGauge>();

            component.name = ((!isFriend) ? ("HpGaugeE" + _listHpGauge.Count) : ("HpGaugeF" + _listHpGauge.Count));
            component.SetTextureType(isLight);
            if (isNumber)
            {
                component.SetShipNumber(_listHpGauge.Count + 1, isFriend, isT);
            }
            return(component);
        }
 public void Dispose()
 {
     if (this._listHpGauge != null)
     {
         using (List <UICircleHPGauge> .Enumerator enumerator = this._listHpGauge.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 UICircleHPGauge current = enumerator.get_Current();
                 if (current != null)
                 {
                     current.get_gameObject().Discard();
                 }
             }
         }
         this._listHpGauge.Clear();
     }
     this._listHpGauge = null;
 }
 public BattleHPGauges()
 {
     this._listHpGauge = new List <UICircleHPGauge>();
     this._hpGauge     = null;
 }
Exemple #12
0
 public BattleHPGauges()
 {
     _listHpGauge = new List <UICircleHPGauge>();
     _hpGauge     = null;
 }