예제 #1
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 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);
        }