示例#1
0
        private void _setCutin(CutInType type)
        {
            _uiShip.mainTexture = null;
            for (int i = 0; i < 3; i++)
            {
                _uiAircraft[i].mainTexture = null;
            }
            switch (type)
            {
            case CutInType.FriendOnly:
            case CutInType.Both:
                _setShipTexture(isFriend: true);
                _setAircraftTexture(FleetType.Friend);
                break;

            case CutInType.EnemyOnly:
                _setShipTexture(isFriend: false);
                _setAircraftTexture(FleetType.Enemy);
                _changeSeaWave(isFriend: false);
                base.transform.localEulerAngles = new Vector3(0f, -180f, 0f);
                isAnimeFinished = true;
                break;
            }
            for (int j = 0; j < 3; j++)
            {
                _airAnimation[j].Stop();
                _airAnimation[j].Play("AircraftCutin" + (j + 1));
            }
            Animation component = ((Component)base.transform).GetComponent <Animation>();

            component.Stop();
            component.Play("AircraftCutinP_1");
        }
示例#2
0
 private void _setCutin(CutInType type)
 {
     if (type == CutInType.Both || type == CutInType.FriendOnly)
     {
         this._setShipTexture(FleetType.Friend);
         this._setAircraftTexture(FleetType.Friend);
         for (int i = 0; i < 3; i++)
         {
             this._airAnimation[i].Stop();
             this._airAnimation[i].Play("AircraftCutin" + (i + 1));
         }
         Animation component = base.get_transform().GetComponent <Animation>();
         component.Stop();
         component.Play("AerialSecondCutIn1");
     }
     else if (type == CutInType.EnemyOnly)
     {
         this._setShipTexture(FleetType.Enemy);
         this._setAircraftTexture(FleetType.Enemy);
         this._changeSeaWave(FleetType.Enemy);
         base.get_transform().set_localEulerAngles(new Vector3(0f, -180f, 0f));
         for (int j = 0; j < 3; j++)
         {
             this._airAnimation[j].Stop();
             this._airAnimation[j].Play("AircraftCutin" + (j + 1));
         }
         Animation component2 = base.get_transform().GetComponent <Animation>();
         component2.Stop();
         component2.Play("AerialSecondCutIn1");
         this._isAnimeFinished = true;
     }
 }
        private bool _initAircraftSecond(object data)
        {
            BattleCameras     battleCameras = BattleTaskManager.GetBattleCameras();
            BattleCutInCamera cutInCamera   = battleCameras.cutInCamera;

            cutInCamera.isCulling = true;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            cutInEffectCamera.isCulling = true;
            CutInType cutInType = (_clsKoukuu2.GetCaptainShip(is_friend: true) != null && _clsKoukuu2.GetCaptainShip(is_friend: false) != null) ? CutInType.Both : ((_clsKoukuu2.GetCaptainShip(is_friend: true) == null) ? CutInType.EnemyOnly : CutInType.FriendOnly);

            if (cutInType == CutInType.Both)
            {
                battleCameras.SetSplitCameras2D(isSplit: true);
                cutInCamera.isCulling       = true;
                cutInEffectCamera.isCulling = true;
            }
            else
            {
                if (cutInType == CutInType.FriendOnly)
                {
                    cutInEffectCamera.isCulling = false;
                }
                battleCameras.SetSplitCameras2D(isSplit: false);
            }
            _prodAerialSecondP1.gameObject.SetActive(true);
            _prodAerialSecondP1.Play(_onAerialSecondPhase1Finished);
            return(false);
        }
示例#4
0
 public void Play(Action callback)
 {
     _isPlaying   = true;
     _actCallback = callback;
     GetComponent <UIPanel>().widgetsAreStatic = false;
     _iType = _chkCutInType();
     _setCutin(_iType);
 }
示例#5
0
 public void Play(Action callback)
 {
     this._isPlaying   = true;
     this._actCallback = callback;
     base.GetComponent <UIPanel>().widgetsAreStatic = false;
     this._iType = this._chkCutInType();
     this._setCutin(this._iType);
 }
示例#6
0
        private void _setCutin(CutInType type)
        {
            switch (type)
            {
            case CutInType.FriendOnly:
            case CutInType.Both:
            {
                _setShipTexture(FleetType.Friend);
                _setAircraftTexture(FleetType.Friend);
                for (int j = 0; j < 3; j++)
                {
                    _airAnimation[j].Stop();
                    _airAnimation[j].Play("AircraftCutin" + (j + 1));
                }
                Animation component2 = ((Component)base.transform).GetComponent <Animation>();
                component2.Stop();
                component2.Play("AerialSecondCutIn1");
                break;
            }

            case CutInType.EnemyOnly:
            {
                _setShipTexture(FleetType.Enemy);
                _setAircraftTexture(FleetType.Enemy);
                _changeSeaWave(FleetType.Enemy);
                base.transform.localEulerAngles = new Vector3(0f, -180f, 0f);
                for (int i = 0; i < 3; i++)
                {
                    _airAnimation[i].Stop();
                    _airAnimation[i].Play("AircraftCutin" + (i + 1));
                }
                Animation component = ((Component)base.transform).GetComponent <Animation>();
                component.Stop();
                component.Play("AerialSecondCutIn1");
                _isAnimeFinished = true;
                break;
            }
            }
        }
示例#7
0
        // ステージ2撃墜処理(敵軍)
        private static void St2EnemyBreak(Fleet enemy, Fleet friend, int unitCount, AirsList enemyAirsList, CutInType cutInType)
        {
            // 迎撃艦を一覧を算出し、それぞれの撃墜量を出す
            var breakPer   = friend.BreakPer;
            var breakFixed = friend.BreakFixed(cutInType);

            // 撃墜処理
            for (int i = 0; i < unitCount; ++i)
            {
                for (int j = 0; j < enemy.Unit[i].Kammusu.Count; ++j)
                {
                    for (int k = 0; k < enemy.Unit[i].Kammusu[j].Weapon.Count; ++k)
                    {
                        if (!enemy.Unit[i].Kammusu[j].Weapon[k].IsStage2)
                        {
                            continue;
                        }
                        // 迎撃艦を選択する
                        int selectKammusuIndex = RandInt(0, breakPer.Count - 1);
                        // 割合撃墜
                        if (RandInt(0, 1) == 1)
                        {
                            int breakCount = (int)(breakPer[selectKammusuIndex] * enemyAirsList[i][j][k]);
                            enemyAirsList[i][j][k] -= breakCount;
                        }
                        // 固定撃墜
                        if (RandInt(0, 1) == 1)
                        {
                            int breakCount = breakFixed[selectKammusuIndex] + 1;
                            breakCount            += CutInAddBonus[(int)cutInType];
                            enemyAirsList[i][j][k] = Math.Max(enemyAirsList[i][j][k] - breakCount, 0);
                        }
                    }
                }
            }
        }
示例#8
0
        // ステージ2撃墜処理(基地航空隊)
        private static void St2LandBaseBreak(LandBase landBase, Fleet enemy, LandBaseAirsList landBaseAirsList, int ti, CutInType cutInType)
        {
            // 迎撃艦を一覧を算出し、それぞれの撃墜量を出す
            var breakPer   = enemy.BreakPer;
            var breakFixed = enemy.BreakFixed(cutInType);

            // 撃墜処理
            for (int wi = 0; wi < landBase.Team[ti].Weapon.Count; ++wi)
            {
                if (!landBase.Team[ti].Weapon[wi].IsStage2X)
                {
                    continue;
                }
                // 迎撃艦を選択する
                int selectKammusuIndex = RandInt(0, breakPer.Count - 1);
                // 割合撃墜
                if (RandInt(0, 1) == 1)
                {
                    int breakCount = (int)(breakPer[selectKammusuIndex] * landBaseAirsList[ti][wi]);
                    landBaseAirsList[ti][wi] -= breakCount;
                }
                // 固定撃墜
                if (RandInt(0, 1) == 1)
                {
                    int breakCount = breakFixed[selectKammusuIndex];
                    breakCount += CutInAddBonus[(int)cutInType];
                    landBaseAirsList[ti][wi] = Math.Max(landBaseAirsList[ti][wi] - breakCount, 0);
                }
            }
        }
示例#9
0
文件: Kammusu.cs 项目: YSRKEN/AWSR
 // 事前計算した値を確定させる
 public void Complete()
 {
     cutInType = CalcCutInType();
     slotCount = DataBase.Kammusu(Id).SlotCount;
 }
        public static ProdAerialCombatP1 Instantiate(ProdAerialCombatP1 prefab, KoukuuModel model, Transform parent, CutInType iType)
        {
            ProdAerialCombatP1 prodAerialCombatP = UnityEngine.Object.Instantiate(prefab);

            prodAerialCombatP.transform.parent        = parent;
            prodAerialCombatP.transform.localPosition = Vector3.zero;
            prodAerialCombatP.transform.localScale    = Vector3.one;
            prodAerialCombatP._clsKoukuu = model;
            prodAerialCombatP._iType     = iType;
            prodAerialCombatP._init();
            return(prodAerialCombatP);
        }
示例#11
0
        public bool _init()
        {
            this._fieldCamera   = BattleTaskManager.GetBattleCameras().friendFieldCamera;
            this._uiPanel       = new UIPanel[2];
            this._uiAirObjF     = new GameObject[2];
            this._uiAirObjE     = new GameObject[2];
            this._cloudPanel    = new UIPanel[2];
            this._bgTex         = new UITexture[2];
            this._cloudParPanel = new UIPanel[2];
            this._cloudPar      = new ParticleSystem[2];
            this._gunPar        = new ParticleSystem[2];
            using (IEnumerator enumerator = Enum.GetValues(typeof(FleetType)).GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    FleetType fleetType = (FleetType)((int)enumerator.get_Current());
                    if (fleetType != FleetType.CombinedFleet)
                    {
                        Util.FindParentToChild <UIPanel>(ref this._uiPanel[(int)fleetType], base.get_transform(), string.Format("{0}Panel", fleetType.ToString()));
                        if (this._uiAirObjF[(int)fleetType] == null)
                        {
                            this._uiAirObjF[(int)fleetType] = this._uiPanel[(int)fleetType].get_transform().FindChild("FAircraft").get_gameObject();
                        }
                        if (this._uiAirObjE[(int)fleetType] == null)
                        {
                            this._uiAirObjE[(int)fleetType] = this._uiPanel[(int)fleetType].get_transform().FindChild("EAircraft").get_gameObject();
                        }
                        Util.FindParentToChild <UIPanel>(ref this._cloudPanel[(int)fleetType], base.get_transform(), string.Format("{0}CloudPanel", fleetType.ToString()));
                        Util.FindParentToChild <UITexture>(ref this._bgTex[(int)fleetType], this._cloudPanel[(int)fleetType].get_transform(), "Bg");
                        Util.FindParentToChild <UIPanel>(ref this._cloudParPanel[(int)fleetType], base.get_transform(), string.Format("{0}CloudParPanel", fleetType.ToString()));
                        Util.FindParentToChild <ParticleSystem>(ref this._gunPar[(int)fleetType], this._cloudPanel[(int)fleetType].get_transform(), "Gun");
                    }
                }
            }
            bool flag  = false;
            bool flag2 = false;

            if (this._clsAerial.IsBakugeki_f() || this._clsAerial.IsRaigeki_f())
            {
                flag = true;
            }
            if (this._clsAerial.IsBakugeki_e() || this._clsAerial.IsRaigeki_e())
            {
                flag2 = true;
            }
            if (flag && flag2)
            {
                this._iType = CutInType.Both;
            }
            else if (flag && !flag2)
            {
                this._iType = CutInType.FriendOnly;
            }
            BattleCameras           battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleCutInCamera       cutInCamera       = battleCameras.cutInCamera;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            if (this._iType == CutInType.Both)
            {
                battleCameras.SetSplitCameras2D(true);
                cutInCamera.isCulling       = true;
                cutInEffectCamera.isCulling = true;
            }
            else if (this._iType == CutInType.FriendOnly)
            {
                cutInCamera.isCulling       = true;
                cutInEffectCamera.isCulling = true;
            }
            Observable.FromCoroutine(new Func <IEnumerator>(this._createAsyncAircrafts), false).Subscribe(delegate(Unit _)
            {
            });
            return(true);
        }
        public static ProdAerialCombatP1 Instantiate(ProdAerialCombatP1 prefab, KoukuuModel model, Transform parent, CutInType iType)
        {
            ProdAerialCombatP1 prodAerialCombatP = Object.Instantiate <ProdAerialCombatP1>(prefab);

            prodAerialCombatP.get_transform().set_parent(parent);
            prodAerialCombatP.get_transform().set_localPosition(Vector3.get_zero());
            prodAerialCombatP.get_transform().set_localScale(Vector3.get_one());
            prodAerialCombatP._clsKoukuu = model;
            prodAerialCombatP._iType     = iType;
            prodAerialCombatP._init();
            return(prodAerialCombatP);
        }
        public bool _init()
        {
            _fieldCamera   = BattleTaskManager.GetBattleCameras().friendFieldCamera;
            _uiPanel       = new UIPanel[2];
            _uiAirObjF     = new GameObject[2];
            _uiAirObjE     = new GameObject[2];
            _cloudPanel    = new UIPanel[2];
            _bgTex         = new UITexture[2];
            _cloudParPanel = new UIPanel[2];
            _cloudPar      = (ParticleSystem[])new ParticleSystem[2];
            _gunPar        = (ParticleSystem[])new ParticleSystem[2];
            foreach (int value in Enum.GetValues(typeof(FleetType)))
            {
                if (value != 2)
                {
                    Util.FindParentToChild(ref _uiPanel[value], base.transform, $"{((FleetType)value).ToString()}Panel");
                    if (_uiAirObjF[value] == null)
                    {
                        _uiAirObjF[value] = _uiPanel[value].transform.FindChild("FAircraft").gameObject;
                    }
                    if (_uiAirObjE[value] == null)
                    {
                        _uiAirObjE[value] = _uiPanel[value].transform.FindChild("EAircraft").gameObject;
                    }
                    Util.FindParentToChild(ref _cloudPanel[value], base.transform, $"{((FleetType)value).ToString()}CloudPanel");
                    Util.FindParentToChild(ref _bgTex[value], _cloudPanel[value].transform, "Bg");
                    Util.FindParentToChild(ref _cloudParPanel[value], base.transform, $"{((FleetType)value).ToString()}CloudParPanel");
                    Util.FindParentToChild <ParticleSystem>(ref _gunPar[value], _cloudPanel[value].transform, "Gun");
                }
            }
            bool flag  = false;
            bool flag2 = false;

            if (_clsAerial.IsBakugeki_f() || _clsAerial.IsRaigeki_f())
            {
                flag = true;
            }
            if (_clsAerial.IsBakugeki_e() || _clsAerial.IsRaigeki_e())
            {
                flag2 = true;
            }
            if (flag && flag2)
            {
                _iType = CutInType.Both;
            }
            else if (flag && !flag2)
            {
                _iType = CutInType.FriendOnly;
            }
            BattleCameras           battleCameras     = BattleTaskManager.GetBattleCameras();
            BattleCutInCamera       cutInCamera       = battleCameras.cutInCamera;
            BattleCutInEffectCamera cutInEffectCamera = BattleTaskManager.GetBattleCameras().cutInEffectCamera;

            if (_iType == CutInType.Both)
            {
                battleCameras.SetSplitCameras2D(isSplit: true);
                cutInCamera.isCulling       = true;
                cutInEffectCamera.isCulling = true;
            }
            else if (_iType == CutInType.FriendOnly)
            {
                cutInCamera.isCulling       = true;
                cutInEffectCamera.isCulling = true;
            }
            Observable.FromCoroutine(_createAsyncAircrafts).Subscribe(delegate
            {
            });
            return(true);
        }
示例#14
0
 public List <int> BreakFixed(CutInType cutInType)
 {
     return(breakFixed[(int)cutInType]);
 }