Exemple #1
0
        public void PlayWeather(string weatherName, System.Action completeCallback = null)
        {
            Stop();

            WeatherName = weatherName;
            WeatherControlData data = GetWeatherControlData(weatherName);

            data.EnableBehaviours(true);

            Particle.InitData(data.ParticleData, this.transform);
            GlobalProperty.InitData(data.GlobalPropertyData);
            Skybox.InitData(data.SkyboxData);
            Ambient.InitData(data.AmbientData, data.TimeData, m_weatherEffect, m_mainLight);

            m_coroutine = StartCoroutine(PlayWeather_Coroutine(completeCallback));
        }
Exemple #2
0
        public void PlayThunder()
        {
            WeatherControlData data = GetWeatherControlData();

            if (!data.ThunderData.Use)
            {
                return;
            }

            if (Ambient.ThunderCoroutine != null)
            {
                StopCoroutine(Ambient.ThunderCoroutine);
                Ambient.ThunderCoroutine = null;
            }

            Ambient.ThunderCoroutine = StartCoroutine(Ambient.PlayThunder_Coroutine(data.ThunderData));
        }
Exemple #3
0
        public float GetBlendWeight()
        {
            float blendWeight             = 0;
            WeatherControlData globalData = null;

            foreach (var pair in m_weatherControlDataDict)
            {
                WeatherControlData data = pair.Value;
                if (data.Area.AreaType == eAreaType.Global)
                {
                    globalData = pair.Value;
                    continue;
                }
                blendWeight = data.GetBlendWeight(m_targetTrans.position);
            }

            return(blendWeight);
        }
Exemple #4
0
        private void InitWeatherControlData()
        {
            if (m_datas == null)
            {
                return;
            }

            if (m_weatherControlDataDict == null)
            {
                m_weatherControlDataDict = new Dictionary <string, WeatherControlData>();
                for (int i = 0; i < m_datas.Length; ++i)
                {
                    WeatherControlData data = m_datas[i];
                    if (data == null)
                    {
                        continue;
                    }
                    m_weatherControlDataDict.Add(data.name, data);
                }
            }
        }
 protected virtual void OnEnable()
 {
     m_script  = target as WeatherControlData;
     m_options = new GUILayoutOption[0];
 }
Exemple #6
0
        public WeatherControlData GetWeatherControlData(string name)
        {
            WeatherControlData controlData = null;

            return(m_weatherControlDataDict.TryGetValue(name, out controlData) ? controlData : null);
        }