Ejemplo n.º 1
0
        private void Awake()
        {
            _iTimeZone = KCV.Battle.Utils.TimeZone.DayTime;
            if (_traFieldCenter == null)
            {
                Util.FindParentToChild(ref _traFieldCenter, base.transform, "CenterAnchor");
            }
            _dicFleetAnchor = new Dictionary <FleetType, Transform>();
            int num = 0;

            foreach (Transform traFleetAnchor in _traFleetAnchorList)
            {
                _dicFleetAnchor.Add((FleetType)num, traFleetAnchor);
                num++;
            }
            _dicCameraAnchors = new Dictionary <CameraAnchorType, Dictionary <FleetType, Transform> >();
            Dictionary <FleetType, Transform> dictionary = new Dictionary <FleetType, Transform>();

            foreach (int value in Enum.GetValues(typeof(FleetType)))
            {
                if (value != 2)
                {
                    dictionary.Add((FleetType)value, base.transform.FindChild($"CameraAnchors/{((FleetType)value).ToString()}OneRowAnchor").transform);
                }
            }
            _dicCameraAnchors.Add(CameraAnchorType.OneRowAnchor, dictionary);
            _dicFleetAnchorOrigine = new Dictionary <FleetType, Vector3>();
            _dicFleetAnchorOrigine.Add(FleetType.Friend, _dicFleetAnchor[FleetType.Friend].transform.position);
            _dicFleetAnchorOrigine.Add(FleetType.Enemy, _dicFleetAnchor[FleetType.Enemy].transform.position);
            _dicSeaLevels = new Dictionary <FleetType, Water>();
            int num2 = 0;

            foreach (Transform traSeaLevel in _traSeaLevelList)
            {
                _dicSeaLevels.Add((FleetType)num2, ((Component)traSeaLevel).GetComponent <Water>());
                _dicSeaLevels[(FleetType)num2].m_WaterMode       = Water.WaterMode.Reflective;
                _dicSeaLevels[(FleetType)num2].waveScale         = 0.02f;
                _dicSeaLevels[(FleetType)num2].reflectionDistort = 1.5f;
                num2++;
            }
            _dicSeaLevels[FleetType.Enemy].SetLayer(Generics.Layers.SplitWater.IntLayer());
            isEnemySeaLevelActive = false;
            _dicWaveDirs          = new Dictionary <FleetType, Vector4>();
            _dicWaveDirs.Add(FleetType.Friend, new Vector4(-3.58f, -22.85f, 1f, -100f));
            _dicWaveDirs.Add(FleetType.Enemy, new Vector4(3.58f, 22.85f, -1f, 100f));
            _dicPSClouds = new Dictionary <FleetType, ParticleSystem>();
            foreach (int value2 in Enum.GetValues(typeof(FleetType)))
            {
                if (value2 != 2)
                {
                    ParticleSystem val = ParticleFile.Instantiate <ParticleSystem>(ParticleFileInfos.BattleAdventFleetCloud);
                    ((UnityEngine.Object)val).name    = $"Cloud{(FleetType)value2}";
                    ((Component)val).transform.parent = base.transform;
                    ((Component)val).SetRenderQueue(3500);
                    ((Component)val).transform.localScale = Vector3.one;
                    ((Component)val).transform.position   = Vector3.zero;
                    val.playOnAwake = false;
                    ((Component)val).SetActive(isActive: false);
                    _dicPSClouds.Add((FleetType)value2, val);
                }
            }
        }
        private void Awake()
        {
            this._iTimeZone = TimeZone.DayTime;
            if (this._traFieldCenter == null)
            {
                Util.FindParentToChild <Transform>(ref this._traFieldCenter, base.get_transform(), "CenterAnchor");
            }
            this._dicFleetAnchor = new Dictionary <FleetType, Transform>();
            int num = 0;

            using (List <Transform> .Enumerator enumerator = this._traFleetAnchorList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    Transform current = enumerator.get_Current();
                    this._dicFleetAnchor.Add((FleetType)num, current);
                    num++;
                }
            }
            this._dicCameraAnchors = new Dictionary <CameraAnchorType, Dictionary <FleetType, Transform> >();
            Dictionary <FleetType, Transform> dictionary = new Dictionary <FleetType, Transform>();

            using (IEnumerator enumerator2 = Enum.GetValues(typeof(FleetType)).GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    FleetType fleetType = (FleetType)((int)enumerator2.get_Current());
                    if (fleetType != FleetType.CombinedFleet)
                    {
                        dictionary.Add(fleetType, base.get_transform().FindChild(string.Format("CameraAnchors/{0}OneRowAnchor", fleetType.ToString())).get_transform());
                    }
                }
            }
            this._dicCameraAnchors.Add(CameraAnchorType.OneRowAnchor, dictionary);
            this._dicFleetAnchorOrigine = new Dictionary <FleetType, Vector3>();
            this._dicFleetAnchorOrigine.Add(FleetType.Friend, this._dicFleetAnchor.get_Item(FleetType.Friend).get_transform().get_position());
            this._dicFleetAnchorOrigine.Add(FleetType.Enemy, this._dicFleetAnchor.get_Item(FleetType.Enemy).get_transform().get_position());
            this._dicSeaLevels = new Dictionary <FleetType, Water>();
            int num2 = 0;

            using (List <Transform> .Enumerator enumerator3 = this._traSeaLevelList.GetEnumerator())
            {
                while (enumerator3.MoveNext())
                {
                    Transform current2 = enumerator3.get_Current();
                    this._dicSeaLevels.Add((FleetType)num2, current2.GetComponent <Water>());
                    this._dicSeaLevels.get_Item((FleetType)num2).m_WaterMode = 1;
                    this._dicSeaLevels.get_Item((FleetType)num2).set_waveScale(0.02f);
                    this._dicSeaLevels.get_Item((FleetType)num2).set_reflectionDistort(1.5f);
                    num2++;
                }
            }
            this._dicSeaLevels.get_Item(FleetType.Enemy).SetLayer(Generics.Layers.SplitWater.IntLayer());
            this.isEnemySeaLevelActive = false;
            this._dicWaveDirs          = new Dictionary <FleetType, Vector4>();
            this._dicWaveDirs.Add(FleetType.Friend, new Vector4(-3.58f, -22.85f, 1f, -100f));
            this._dicWaveDirs.Add(FleetType.Enemy, new Vector4(3.58f, 22.85f, -1f, 100f));
            this._dicPSClouds = new Dictionary <FleetType, ParticleSystem>();
            using (IEnumerator enumerator4 = Enum.GetValues(typeof(FleetType)).GetEnumerator())
            {
                while (enumerator4.MoveNext())
                {
                    FleetType fleetType2 = (FleetType)((int)enumerator4.get_Current());
                    if (fleetType2 != FleetType.CombinedFleet)
                    {
                        ParticleSystem particleSystem = ParticleFile.Instantiate <ParticleSystem>(ParticleFileInfos.BattleAdventFleetCloud);
                        particleSystem.set_name(string.Format("Cloud{0}", fleetType2));
                        particleSystem.get_transform().set_parent(base.get_transform());
                        particleSystem.SetRenderQueue(3500);
                        particleSystem.get_transform().set_localScale(Vector3.get_one());
                        particleSystem.get_transform().set_position(Vector3.get_zero());
                        particleSystem.set_playOnAwake(false);
                        particleSystem.SetActive(false);
                        this._dicPSClouds.Add(fleetType2, particleSystem);
                    }
                }
            }
        }