Exemple #1
0
        public virtual void Init(StageEntry entry, ConfigWeatherData fromWeatherData, string toWeatherName, float renderingTimer, float weatherTimer)
        {
            this._currentBaseWeatherName = toWeatherName;
            ConfigWeatherData weatherDataByName = this.GetWeatherDataByName(toWeatherName);

            this._currentRendertingData = (ConfigStageRenderingData)fromWeatherData.configRenderingData.Clone();
            this._currentRendertingData.ApplyGlobally();
            this._initBaseRenderingData = weatherDataByName.configRenderingData as ConfigStageRenderingData;
            this._renderingDataStack.Push(0, new RenderingDataTransition(this._initBaseRenderingData), true);
            if (renderingTimer > 0f)
            {
                this.TransitRenderingData(this._initBaseRenderingData, renderingTimer);
            }
            else
            {
                this.SetRenderingDataImmediately(this._initBaseRenderingData);
            }
            this.SetSubWeathersImmediately(fromWeatherData.configSubWeathers);
            this._initBaseSubWeather = weatherDataByName.configSubWeathers;
            this._subWeatherStack.Push(0, new SubWeatherTransition(this._initBaseSubWeather, 0), true);
            if (weatherTimer > 0f)
            {
                this.TransitSubWeather(this._initBaseSubWeather, weatherTimer);
            }
            else
            {
                this.SetSubWeathersImmediately(this._initBaseSubWeather);
            }
            this.CommonInit(entry);
        }
Exemple #2
0
        public void SetBaseWeather(string weatherName, float duration)
        {
            this._currentBaseWeatherName = weatherName;
            ConfigWeatherData weatherDataByName = this.GetWeatherDataByName(weatherName);

            this.SetBaseRenderingData(weatherDataByName.configRenderingData as ConfigStageRenderingData, duration);
            this.SetBaseSubWeather(weatherDataByName.configSubWeathers, duration);
        }
Exemple #3
0
 public virtual void Reset(StageEntry entry, ConfigWeatherData weatherData)
 {
     this._initBaseRenderingData = weatherData.configRenderingData as ConfigStageRenderingData;
     this._renderingDataStack.Set(0, new RenderingDataTransition(this._initBaseRenderingData), true);
     this.SetRenderingDataImmediately(this._initBaseRenderingData);
     this._currentRendertingData.ApplyGlobally();
     this._initBaseSubWeather = weatherData.configSubWeathers;
     this._subWeatherStack.Set(0, new SubWeatherTransition(this._initBaseSubWeather, 0), true);
     this.SetSubWeathersImmediately(this._initBaseSubWeather);
     this.CommonInit(entry);
 }
Exemple #4
0
        public int PushWeather(string weatherName, float transitDuration)
        {
            ConfigWeatherData weatherDataByName = this.GetWeatherDataByName(weatherName);
            int renderingIdx = this.PushRenderingData(weatherDataByName.configRenderingData as ConfigStageRenderingData, transitDuration);
            int settingIx    = -1;

            if (weatherDataByName.configSubWeathers.stageEffectSetting != null)
            {
                settingIx = Singleton <StageManager> .Instance.PushStageSettingData(weatherDataByName.configSubWeathers.stageEffectSetting);
            }
            return(this.PushSubWeatherData(weatherDataByName.configSubWeathers, renderingIdx, settingIx, transitDuration));
        }
Exemple #5
0
        public virtual void Init(StageEntry entry, string weatherName)
        {
            this._currentBaseWeatherName = weatherName;
            ConfigWeatherData weatherDataByName = this.GetWeatherDataByName(weatherName);

            this._initBaseRenderingData = weatherDataByName.configRenderingData as ConfigStageRenderingData;
            this._renderingDataStack.Push(0, new RenderingDataTransition(this._initBaseRenderingData), true);
            this._currentRendertingData = (ConfigStageRenderingData)this._initBaseRenderingData.Clone();
            this._currentRendertingData.ApplyGlobally();
            this._initBaseSubWeather = weatherDataByName.configSubWeathers;
            this._subWeatherStack.Push(0, new SubWeatherTransition(this._initBaseSubWeather, 0), true);
            this.SetSubWeathersImmediately(this._initBaseSubWeather);
            this.CommonInit(entry);
        }
Exemple #6
0
 public void SetWeahterImmediately(ConfigWeatherData config)
 {
     if (!Application.isPlaying)
     {
         if (config.configRenderingData != null)
         {
             config.configRenderingData.ApplyGlobally();
         }
     }
     else
     {
         this.SetRenderingDataImmediately(config.configRenderingData as ConfigStageRenderingData);
         this._currentRendertingData.ApplyGlobally();
     }
     this.SetSubWeathersImmediately(config.configSubWeathers);
 }
Exemple #7
0
        public static ConfigWeatherData LoadFromFile(ConfigWeather config)
        {
            if (config == null)
            {
                return(null);
            }
            ConfigWeatherData data = new ConfigWeatherData();

            if (!string.IsNullOrEmpty(config.renderingDataPath))
            {
                data.configRenderingData = ConfigUtil.LoadConfig <ConfigBaseRenderingData>(config.renderingDataPath);
            }
            data.configSubWeathers = ConfigSubWeatherCollection.LoadFromFile(config);
            data.configSubWeathers.stageEffectSetting = config.stageEffectSetting;
            return(data);
        }
Exemple #8
0
 public static void ReloadFromFile()
 {
     _weatherDataDict = new Dictionary <string, ConfigWeatherData>();
     string[] weatherEntryPathes = GlobalDataManager.metaConfig.weatherEntryPathes;
     for (int i = 0; i < weatherEntryPathes.Length; i++)
     {
         ConfigWeatherRegistry registry = ConfigUtil.LoadConfig <ConfigWeatherRegistry>(weatherEntryPathes[i]);
         if (registry.entries != null)
         {
             for (int j = 0; j < registry.entries.Length; j++)
             {
                 ConfigWeatherEntry entry  = registry.entries[j];
                 ConfigWeather      config = Miscs.LoadResource <ConfigWeather>(entry.dataPath, BundleType.RESOURCE_FILE);
                 _weatherDataDict.Add(entry.name, ConfigWeatherData.LoadFromFile(config));
             }
         }
     }
 }
Exemple #9
0
        private ConfigWeatherData GetWeatherDataByName(string name)
        {
            ConfigWeatherData data = !string.IsNullOrEmpty(name) ? WeatherData.GetWeatherDataConfig(name) : new ConfigWeatherData();

            if (data.configRenderingData == null)
            {
                if (this._currentRendertingData != null)
                {
                    data.configRenderingData = this._currentRendertingData.Clone();
                }
                else
                {
                    data.configRenderingData = ConfigStageRenderingData.CreateDefault();
                }
            }
            if (data.configSubWeathers == null)
            {
                data.configSubWeathers = new ConfigSubWeatherCollection();
            }
            return(data);
        }
Exemple #10
0
        private Vector3 InitAfterCreateStage(StageEntry stageEntry, MonoBasePerpStage perpStage, Vector3 preStagePos, bool isBorn, string baseWeatherName, MonoBasePerpStage.ContinueWeatherDataSettings continueData, bool isContinued)
        {
            Vector3 zero    = Vector3.zero;
            Vector3 vector2 = Vector3.zero;

            if (!string.IsNullOrEmpty(stageEntry.LocationPointName))
            {
                perpStage.transform.position = Vector3.zero;
                perpStage.transform.position = -perpStage.transform.Find(stageEntry.LocationPointName).localPosition;
                vector2 = perpStage.transform.position - preStagePos;
            }
            if (this._activeStageEntry == null)
            {
                perpStage.Init(stageEntry, baseWeatherName);
            }
            else
            {
                float             renderingTimer  = 0f;
                float             weatherTimer    = 0f;
                ConfigWeatherData fromWeatherData = null;
                ConfigWeatherData toWeatherData   = null;
                string            toWeatherName   = null;
                if (continueData != null)
                {
                    renderingTimer  = continueData.renderingDataContinueTimer;
                    weatherTimer    = continueData.weatherContinueTimer;
                    fromWeatherData = continueData.currentWeatherData;
                    toWeatherData   = continueData.continueWeatherData;
                    toWeatherName   = continueData.continueWeatherName;
                }
                if (this._activeStageEntry.PerpStagePrefabPath != stageEntry.PerpStagePrefabPath)
                {
                    if (isContinued)
                    {
                        if (renderingTimer > 0f)
                        {
                            if (toWeatherName != null)
                            {
                                perpStage.Init(stageEntry, fromWeatherData, toWeatherName, renderingTimer, weatherTimer);
                            }
                            else
                            {
                                perpStage.Init(stageEntry, fromWeatherData, toWeatherData, renderingTimer, weatherTimer);
                            }
                        }
                        else if (toWeatherName != null)
                        {
                            perpStage.Init(stageEntry, toWeatherName);
                        }
                        else
                        {
                            perpStage.Init(stageEntry, toWeatherData);
                        }
                    }
                    else
                    {
                        perpStage.Init(stageEntry, baseWeatherName);
                    }
                }
                else if (isContinued)
                {
                    if (renderingTimer > 0f)
                    {
                        perpStage.TransitWeatherData(toWeatherData, renderingTimer, weatherTimer);
                    }
                    else
                    {
                        perpStage.Reset(stageEntry, toWeatherData);
                    }
                }
                else
                {
                    perpStage.Reset(stageEntry, WeatherData.GetWeatherDataConfig(baseWeatherName));
                }
                this.CleanForStageTransit();
            }
            GameObject obj2 = (GameObject)UnityEngine.Object.Instantiate(Miscs.LoadResource(stageEntry.GetEnvPrefabPath(), BundleType.RESOURCE_FILE));

            obj2.transform.position = Vector3.zero;
            obj2.transform.rotation = Quaternion.identity;
            MonoStageEnv component = obj2.GetComponent <MonoStageEnv>();
            Vector3      vector3   = new Vector3(0f, -0.05f, 0f);
            Transform    transform = Miscs.FindFirstChildGivenLayerAndCollider(obj2.transform, LayerMask.NameToLayer("StageCollider"));

            if (transform != null)
            {
                transform.position += vector3;
            }
            this.RegisterStage(stageEntry, perpStage, component);
            return(vector2);
        }