Beispiel #1
0
        private void OnNightMessageFinished()
        {
            BattleCutInCamera    cutInCamera = BattleTaskManager.GetBattleCameras().cutInCamera;
            SlotitemModel_Battle touchPlane  = _clsNightCombat.GetTouchPlane(is_friend: true);
            SlotitemModel_Battle touchPlane2 = _clsNightCombat.GetTouchPlane(is_friend: false);

            _prodAerialTouchPlane = ((!(cutInCamera.transform.GetComponentInChildren <ProdAerialTouchPlane>() != null)) ? ProdAerialTouchPlane.Instantiate(Resources.Load <ProdAerialTouchPlane>("Prefabs/Battle/Production/AerialCombat/ProdAerialTouchPlane"), cutInCamera.transform) : cutInCamera.transform.GetComponentInChildren <ProdAerialTouchPlane>());
            _prodAerialTouchPlane.transform.localPosition = Vector3.zero;
            _prodAerialTouchPlane.Init(touchPlane, touchPlane2);
            if (_clsNightCombat.GetRationData() != null)
            {
                ProdCombatRation pcr = ProdCombatRation.Instantiate(((Component)BattleTaskManager.GetPrefabFile().prefabProdCombatRation).GetComponent <ProdCombatRation>(), BattleTaskManager.GetBattleCameras().cutInCamera.transform, _clsNightCombat.GetRationData());
                pcr.SetOnStageReady(delegate
                {
                    if (_prodNightRadarDeployment != null)
                    {
                        _prodNightRadarDeployment.RadarObjectConvergence();
                    }
                    Mem.DelComponentSafe(ref _prodNightRadarDeployment);
                }).Play(delegate
                {
                    _clsState.AddState(InitSearchNFlare, UpdateSearchNFlare);
                });
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Register(delegate
                {
                    Mem.DelComponentSafe(ref pcr);
                });
            }
            else
            {
                _clsState.AddState(InitSearchNFlare, UpdateSearchNFlare);
            }
        }
 private SlotitemModel_Battle getProdPlane(SakutekiModel model)
 {
     using (List <List <SlotitemModel_Battle> > .Enumerator enumerator = model.planes_f.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             List <SlotitemModel_Battle> current = enumerator.get_Current();
             if (current != null)
             {
                 using (List <SlotitemModel_Battle> .Enumerator enumerator2 = current.GetEnumerator())
                 {
                     while (enumerator2.MoveNext())
                     {
                         SlotitemModel_Battle current2 = enumerator2.get_Current();
                         if (current2 != null)
                         {
                             return(current2);
                         }
                     }
                 }
             }
         }
     }
     return(null);
 }
Beispiel #3
0
 public static SlotitemModel_Battle GetDetectionScoutingPlane(List <List <SlotitemModel_Battle> > models)
 {
     using (List <List <SlotitemModel_Battle> > .Enumerator enumerator = models.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             List <SlotitemModel_Battle> current = enumerator.get_Current();
             if (current != null)
             {
                 using (List <SlotitemModel_Battle> .Enumerator enumerator2 = current.GetEnumerator())
                 {
                     while (enumerator2.MoveNext())
                     {
                         SlotitemModel_Battle current2 = enumerator2.get_Current();
                         if (current2 != null)
                         {
                             return(current2);
                         }
                     }
                 }
             }
         }
     }
     return(null);
 }
Beispiel #4
0
 public static ShipRecoveryType __HasRecoveryItem__(List <SlotitemModel_Battle> slotitems, SlotitemModel_Battle slotitem_ex)
 {
     if (slotitem_ex != null)
     {
         if (slotitem_ex.MstId == 42)
         {
             return(ShipRecoveryType.Personnel);
         }
         if (slotitem_ex.MstId == 43)
         {
             return(ShipRecoveryType.Goddes);
         }
     }
     for (int i = 0; i < slotitems.get_Count(); i++)
     {
         SlotitemModel_Battle slotitemModel_Battle = slotitems.get_Item(i);
         if (slotitemModel_Battle != null)
         {
             if (slotitemModel_Battle.MstId == 42)
             {
                 return(ShipRecoveryType.Personnel);
             }
             if (slotitemModel_Battle.MstId == 43)
             {
                 return(ShipRecoveryType.Goddes);
             }
         }
     }
     return(ShipRecoveryType.None);
 }
Beispiel #5
0
        private void OnNightMessageFinished()
        {
            BattleCutInCamera    cutInCamera = BattleTaskManager.GetBattleCameras().cutInCamera;
            SlotitemModel_Battle touchPlane  = this._clsNightCombat.GetTouchPlane(true);
            SlotitemModel_Battle touchPlane2 = this._clsNightCombat.GetTouchPlane(false);

            this._prodAerialTouchPlane = ((!(cutInCamera.get_transform().GetComponentInChildren <ProdAerialTouchPlane>() != null)) ? ProdAerialTouchPlane.Instantiate(Resources.Load <ProdAerialTouchPlane>("Prefabs/Battle/Production/AerialCombat/ProdAerialTouchPlane"), cutInCamera.get_transform()) : cutInCamera.get_transform().GetComponentInChildren <ProdAerialTouchPlane>());
            this._prodAerialTouchPlane.get_transform().set_localPosition(Vector3.get_zero());
            this._prodAerialTouchPlane.Init(touchPlane, touchPlane2);
            if (this._clsNightCombat.GetRationData() != null)
            {
                ProdCombatRation pcr = ProdCombatRation.Instantiate(BattleTaskManager.GetPrefabFile().prefabProdCombatRation.GetComponent <ProdCombatRation>(), BattleTaskManager.GetBattleCameras().cutInCamera.get_transform(), this._clsNightCombat.GetRationData());
                pcr.SetOnStageReady(delegate
                {
                    if (this._prodNightRadarDeployment != null)
                    {
                        this._prodNightRadarDeployment.RadarObjectConvergence();
                    }
                    Mem.DelComponentSafe <ProdNightRadarDeployment>(ref this._prodNightRadarDeployment);
                }).Play(delegate
                {
                    this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitSearchNFlare), new StatementMachine.StatementMachineUpdate(this.UpdateSearchNFlare));
                });
                ObserverActionQueue observerAction = BattleTaskManager.GetObserverAction();
                observerAction.Register(delegate
                {
                    Mem.DelComponentSafe <ProdCombatRation>(ref pcr);
                });
            }
            else
            {
                this._clsState.AddState(new StatementMachine.StatementMachineInitialize(this.InitSearchNFlare), new StatementMachine.StatementMachineUpdate(this.UpdateSearchNFlare));
            }
        }
Beispiel #6
0
        private bool _initAircraftCombatPhase2(object data)
        {
            BattleCutInCamera              cutInCamera          = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera    = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            this._prodAerialCombatP2.get_gameObject().SetActive(true);
            Object.Destroy(this._prodAerialCombatP1.get_gameObject());
            cutInCamera.cullingMask       = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask = Generics.Layers.CutIn;
            cutInCamera.depth             = 5f;
            cutInEffectCamera.depth       = 4f;
            cutInEffectCamera.glowEffect.set_enabled(true);
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(false);
            SlotitemModel_Battle touchPlane  = this._clsKoukuu1.GetTouchPlane(true);
            SlotitemModel_Battle touchPlane2 = this._clsKoukuu1.GetTouchPlane(false);

            this._prodAerialTouchPlane = ProdAerialTouchPlane.Instantiate(Resources.Load <ProdAerialTouchPlane>("Prefabs/Battle/Production/AerialCombat/ProdAerialTouchPlane"), cutInCamera2.get_transform());
            this._prodAerialTouchPlane.get_transform().set_localPosition(Vector3.get_zero());
            this._prodAerialTouchPlane.Init(touchPlane, touchPlane2);
            this._prodAerialCombatP2.Play(new Action(this._onAircraftCombatFinished), dicFriendBattleShips, dicEnemyBattleShips);
            return(false);
        }
Beispiel #7
0
 public static Texture2D LoadTexture(SlotitemModel_Battle model)
 {
     if (model == null)
     {
         return(null);
     }
     return(SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(model.GetGraphicId(), 4));
 }
        public void SetSlotData(SlotitemModel_Battle[] models, ProdTranscendenceCutIn.AnimationList iList)
        {
            switch (iList)
            {
            case ProdTranscendenceCutIn.AnimationList.ProdTAMainBatteryx3:
            {
                int num = 0;
                for (int i = 0; i < models.Length; i++)
                {
                    SlotitemModel_Battle slotItem = models[i];
                    if (this._listSlots.get_Item(num) != null)
                    {
                        this._listSlots.get_Item(num).SetSlotItem(slotItem);
                        num++;
                    }
                }
                break;
            }

            case ProdTranscendenceCutIn.AnimationList.ProdTATorpedox2:
            {
                int num2 = 0;
                using (List <ProdShellingSlot.Slot> .Enumerator enumerator = this._listSlots.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ProdShellingSlot.Slot current = enumerator.get_Current();
                        if (num2 == 0)
                        {
                            current.SetSlotItem(models[0]);
                        }
                        else if (num2 > 0)
                        {
                            current.SetSlotItem(models[1]);
                        }
                        num2++;
                    }
                }
                break;
            }

            case ProdTranscendenceCutIn.AnimationList.ProdTAMainBatteryNTorpedo:
            {
                int num3 = 0;
                for (int j = 0; j < models.Length; j++)
                {
                    SlotitemModel_Battle slotItem2 = models[j];
                    if (this._listSlots.get_Item(num3) != null)
                    {
                        this._listSlots.get_Item(num3).SetSlotItem(slotItem2);
                        num3++;
                    }
                }
                break;
            }
            }
        }
 public bool Init(SlotitemModel_Battle model, bool isFlip)
 {
     if (!Init(model))
     {
         return(false);
     }
     uiTexture.flip = (isFlip ? UIBasicSprite.Flip.Horizontally : UIBasicSprite.Flip.Nothing);
     return(true);
 }
 public bool Init(SlotitemModel_Battle model, bool isFlip)
 {
     if (!this.Init(model))
     {
         return(false);
     }
     this.uiTexture.flip = ((!isFlip) ? UIBasicSprite.Flip.Nothing : UIBasicSprite.Flip.Horizontally);
     return(true);
 }
 public bool Init(SlotitemModel_Battle model)
 {
     if (model == null || !model.IsPlane())
     {
         return(false);
     }
     uiTexture.mainTexture = SlotItemUtils.LoadUniDirGlowTexture(model);
     uiTexture.localSize   = ResourceManager.SLOTITEM_TEXTURE_SIZE[7];
     return(true);
 }
Beispiel #12
0
        private string ToString_TouchPlane(bool is_friend)
        {
            string empty = string.Empty;
            SlotitemModel_Battle touchPlane = GetTouchPlane(is_friend);

            if (touchPlane == null)
            {
                return(empty + string.Format("{0}側触接:無し ", (!is_friend) ? "相手" : "味方"));
            }
            return(empty + string.Format("{0}側触接:{1} ", (!is_friend) ? "相手" : "味方", touchPlane));
        }
            public bool SetSlotItem(SlotitemModel_Battle model, bool isSlotIconActive)
            {
                bool flag = model?.IsPlane() ?? false;

                _isPlane = flag;
                _uiSlotIcon.mainTexture = ((model == null) ? null : ((!flag) ? SlotItemUtils.LoadTexture(model) : SlotItemUtils.LoadUniDirTexture(model)));
                _uiSlotIcon.localSize   = ((!flag) ? ResourceManager.SLOTITEM_TEXTURE_SIZE[4] : ResourceManager.SLOTITEM_TEXTURE_SIZE[7]);
                _uiSlotName.text        = ((model != null && !flag) ? model.Name : string.Empty);
                this.isSlotIconActive   = isSlotIconActive;
                return(true);
            }
Beispiel #14
0
 public static string GetEnemyAircraftType(SlotitemModel_Battle model)
 {
     for (int i = 0; i < _dicAircraftType.Count; i++)
     {
         List <int> list = _dicAircraftType[(AircraftType)i];
         if (list.IndexOf(model.MstId) != -1)
         {
             return(((AircraftType)i).ToString());
         }
     }
     return(AircraftType.Type1.ToString());
 }
 protected virtual void PlayShellingSlot(SlotitemModel_Battle model, BaseProdLine.AnimationName iName, bool isFriend, float delay)
 {
     if (model != null)
     {
         Observable.Timer(TimeSpan.FromSeconds(delay)).Subscribe(delegate
         {
             ProdShellingSlotLine prodShellingSlotLine = BattleTaskManager.GetPrefabFile().prodShellingSlotLine;
             prodShellingSlotLine.SetSlotData(model, isFriend);
             prodShellingSlotLine.Play(iName, isFriend, null);
         });
     }
 }
Beispiel #16
0
 public static string GetEnemyAircraftType(SlotitemModel_Battle model)
 {
     for (int i = 0; i < SlotItemUtils._dicAircraftType.get_Count(); i++)
     {
         List <int> list = SlotItemUtils._dicAircraftType.get_Item((SlotItemUtils.AircraftType)i);
         if (list.IndexOf(model.MstId) != -1)
         {
             return(((SlotItemUtils.AircraftType)i).ToString());
         }
     }
     return(SlotItemUtils.AircraftType.Type1.ToString());
 }
        public void Init(SlotitemModel_Battle slotModelF, SlotitemModel_Battle slotModelE)
        {
            base.get_gameObject().SetActive(true);
            if (this._uiGameObjF == null)
            {
                this._uiGameObjF = base.get_transform().FindChild("AircraftF").get_gameObject();
            }
            if (this._uiGameObjE == null)
            {
                this._uiGameObjE = base.get_transform().FindChild("AircraftE").get_gameObject();
            }
            if (this._uiAircraftF == null)
            {
                this._uiAircraftF = this._uiGameObjF.get_transform().FindChild("Swing/Aircraft").GetComponent <UITexture>();
            }
            if (this._uiAircraftE == null)
            {
                this._uiAircraftE = this._uiGameObjE.get_transform().FindChild("Swing/Aircraft").GetComponent <UITexture>();
            }
            if (slotModelF != null)
            {
                this._uiGameObjF.SetActive(true);
                this._uiAircraftF.flip        = UIBasicSprite.Flip.Nothing;
                this._uiAircraftF.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(slotModelF.MstId, 6);
            }
            else
            {
                this._uiGameObjF.SetActive(false);
            }
            if (slotModelE != null)
            {
                this._uiGameObjE.SetActive(true);
                this._uiAircraftE.flip = UIBasicSprite.Flip.Horizontally;
                if (BattleTaskManager.GetBattleManager() is PracticeBattleManager)
                {
                    this._uiAircraftE.mainTexture = SingletonMonoBehaviour <ResourceManager> .Instance.SlotItemTexture.Load(slotModelE.MstId, 6);

                    this._uiAircraftE.MakePixelPerfect();
                }
                else
                {
                    this._uiAircraftE.mainTexture = SlotItemUtils.LoadTexture(slotModelE);
                    this._uiAircraftE.MakePixelPerfect();
                    this._uiAircraftE.get_transform().set_localScale((slotModelE.MstId > 500) ? new Vector3(0.7f, 0.7f, 0.7f) : new Vector3(0.8f, 0.8f, 0.8f));
                    AircraftOffsetInfo aircraftOffsetInfo = SlotItemUtils.GetAircraftOffsetInfo(slotModelE.MstId);
                    this._uiAircraftE.flip = UIBasicSprite.Flip.Nothing;
                }
            }
            else
            {
                this._uiGameObjE.SetActive(false);
            }
        }
        public void SetSlotData(SlotitemModel_Battle[] models)
        {
            int num = 0;

            for (int i = 0; i < models.Length; i++)
            {
                SlotitemModel_Battle slotItem = models[i];
                if (this._listSlots.get_Item(num) != null)
                {
                    this._listSlots.get_Item(num).SetSlotItem(slotItem);
                    num++;
                }
            }
        }
 protected virtual void playShellingSlot(SlotitemModel_Battle model, BaseProdLine.AnimationName iName, bool isFriend, float delay)
 {
     if (model == null)
     {
         return;
     }
     Observable.Timer(TimeSpan.FromSeconds((double)delay)).Subscribe(delegate(long _)
     {
         KCV.Utils.SoundUtils.PlaySE(SEFIleInfos.SE_048);
         ProdShellingSlotLine prodShellingSlotLine = BattleTaskManager.GetPrefabFile().prodShellingSlotLine;
         prodShellingSlotLine.SetSlotData(model, isFriend);
         prodShellingSlotLine.Play(iName, isFriend, null);
     });
 }
        private string ToString_TouchPlane(bool is_friend)
        {
            string text = string.Empty;
            SlotitemModel_Battle touchPlane = this.GetTouchPlane(is_friend);

            if (touchPlane == null)
            {
                text += string.Format("{0}側触接:無し ", (!is_friend) ? "相手" : "味方");
            }
            else
            {
                text += string.Format("{0}側触接:{1} ", (!is_friend) ? "相手" : "味方", touchPlane);
            }
            return(text);
        }
Beispiel #21
0
        private void _setAttackSubType()
        {
            int shipType = Attacker.ShipType;
            SlotitemModel_Battle slotitem = GetSlotitem();

            if (slotitem != null && (slotitem.Type3 == 5 || slotitem.Type3 == 32))
            {
                _attack_type = BattleAttackKind.Gyorai;
            }
            else if (slotitem != null && slotitem.Type3 != 1 && slotitem.Type3 != 2 && slotitem.Type3 != 3 && slotitem.Type3 != 4 && slotitem.Type3 != 5 && slotitem.Type3 != 32)
            {
                _slots = new List <SlotitemModel_Battle>
                {
                    null,
                    null,
                    null
                };
            }
        }
        private void _setAttackSubType()
        {
            SType shipType = (SType)this.Attacker.ShipType;
            SlotitemModel_Battle slotitem = this.GetSlotitem();

            if (slotitem != null && (slotitem.Type3 == 5 || slotitem.Type3 == 32))
            {
                this._attack_type = BattleAttackKind.Gyorai;
            }
            else if (slotitem != null)
            {
                if (slotitem.Type3 != 1 && slotitem.Type3 != 2 && slotitem.Type3 != 3 && slotitem.Type3 != 4 && slotitem.Type3 != 5 && slotitem.Type3 != 32)
                {
                    List <SlotitemModel_Battle> list = new List <SlotitemModel_Battle>();
                    list.Add(null);
                    list.Add(null);
                    list.Add(null);
                    this._slots = list;
                }
            }
        }
Beispiel #23
0
 private void setAircraft(SlotitemModel_Battle model)
 {
     if (model == null)
     {
         _isAircraft = false;
         _listAircraft.ForEach(delegate(UITexture x)
         {
             x.mainTexture = null;
         });
     }
     else
     {
         _isAircraft = true;
         Texture2D mainTexture = KCV.Battle.Utils.SlotItemUtils.LoadUniDirTexture(model);
         foreach (UITexture item in _listAircraft)
         {
             item.mainTexture = mainTexture;
             item.localSize   = ResourceManager.SLOTITEM_TEXTURE_SIZE[6];
         }
     }
 }
Beispiel #24
0
        private bool _initAircraftCombatPhase2(object data)
        {
            BattleCutInCamera              cutInCamera          = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInCamera              cutInCamera2         = BattleTaskManager.GetBattleCameras().cutInCamera;
            BattleCutInEffectCamera        cutInEffectCamera    = BattleTaskManager.GetBattleCameras().cutInEffectCamera;
            Dictionary <int, UIBattleShip> dicFriendBattleShips = BattleTaskManager.GetBattleShips().dicFriendBattleShips;
            Dictionary <int, UIBattleShip> dicEnemyBattleShips  = BattleTaskManager.GetBattleShips().dicEnemyBattleShips;

            _prodAerialCombatP2.gameObject.SetActive(true);
            cutInCamera.cullingMask              = (Generics.Layers.UI2D | Generics.Layers.CutIn);
            cutInEffectCamera.cullingMask        = Generics.Layers.CutIn;
            cutInCamera.depth                    = 5f;
            cutInEffectCamera.depth              = 4f;
            cutInEffectCamera.glowEffect.enabled = true;
            BattleTaskManager.GetBattleCameras().SetSplitCameras2D(isSplit: false);
            SlotitemModel_Battle touchPlane  = _clsKoukuu.GetTouchPlane(is_friend: true);
            SlotitemModel_Battle touchPlane2 = _clsKoukuu.GetTouchPlane(is_friend: false);

            _prodAerialTouchPlane.SetActive(isActive: true);
            _prodAerialTouchPlane.Init(touchPlane, touchPlane2);
            _prodAerialCombatP2.Play(_onAircraftCombatFinished, dicFriendBattleShips, dicEnemyBattleShips);
            Object.Destroy(_prodAerialCombatP1.gameObject);
            return(false);
        }
        private void setAircraft(SlotitemModel_Battle model)
        {
            if (model == null)
            {
                this._isAircraft = false;
                this._listAircraft.ForEach(delegate(UITexture x)
                {
                    x.mainTexture = null;
                });
                return;
            }
            this._isAircraft = true;
            Texture2D mainTexture = KCV.Battle.Utils.SlotItemUtils.LoadUniDirTexture(model);

            using (List <UITexture> .Enumerator enumerator = this._listAircraft.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    UITexture current = enumerator.get_Current();
                    current.mainTexture = mainTexture;
                    current.localSize   = ResourceManager.SLOTITEM_TEXTURE_SIZE.get_Item(6);
                }
            }
        }
 public void SetSlotData(SlotitemModel_Battle model, bool isFriend)
 {
     this._prodShellingSlot.SetSlotData(model);
 }
 public void SetSlotData(SlotitemModel_Battle model)
 {
     _listSlots[0].SetSlotItem(model);
     _clsGlowIcon.Init(model);
 }
Beispiel #28
0
 public static Texture2D LoadUniDirGlowTexture(SlotitemModel_Battle model)
 {
     return(LoadTexture(model.GetGraphicId(), 7));
 }
Beispiel #29
0
 public static UITexture LoadTexture(ref UITexture tex, SlotitemModel_Battle model)
 {
     tex.mainTexture = LoadTexture(model);
     tex.localSize   = ResourceManager.SLOTITEM_TEXTURE_SIZE[4];
     return(tex);
 }
 public bool SetSlotItem(SlotitemModel_Battle model)
 {
     return(SetSlotItem(model, isSlotIconActive: true));
 }