Esempio n. 1
0
        private void Update()
        {
            UpdateMainThreadActions();

#if UNITY_EDITOR
            if (transform.position != Vector3.zero || transform.localScale != Vector3.one || transform.rotation != Quaternion.identity)
            {
                Debug.LogError("For correct rendering, weather maker prefab should have position and rotation of 0, and scale of 1.");
            }

            if (_WeatherProfile != lastProfile)
            {
                if (WeatherProfileChanged != null)
                {
                    WeatherProfileChanged.Invoke(lastProfile, _WeatherProfile);
                }
                lastProfile = _WeatherProfile;
                UpdateWeatherProfile();
            }

            if (Application.isPlaying)
            {
#endif

            CheckForPrecipitationChange();
            UpdateCollision();
            UpdateClouds();

#if UNITY_EDITOR
        }
#endif

            UpdateShaders();
            UpdateCameras();
        }
Esempio n. 2
0
        private void Update()
        {
            UpdateMainThreadActions();

#if UNITY_EDITOR
            if (transform.position != Vector3.zero || transform.localScale != Vector3.one || transform.rotation != Quaternion.identity)
            {
                Debug.LogError("For correct rendering, weather maker prefab should have position and rotation of 0, and scale of 1.");
            }
#endif

            // only for editor mode, detect when inspector has dragged in a new profile
            if (_WeatherProfile != lastProfile)
            {
                if (WeatherProfileChanged != null)
                {
                    WeatherProfileChanged.Invoke(lastProfile, _WeatherProfile);
                }
                lastProfile = _WeatherProfile;
                UpdateWeatherProfile();
            }

#if UNITY_EDITOR
            if (Application.isPlaying)
            {
#endif

            CheckForPrecipitationChange();
            UpdateCollision();
            UpdateClouds();

#if UNITY_EDITOR
        }
#endif

            UpdateShaders();
            UpdateCameras();
            LightManagerScript.Sun   = Sun;
            LightManagerScript.Moons = Moons;
        }