Example #1
0
        protected virtual void OnPreRender()
        {
            if (BaseAppSetting.GetInstance().quality == 0)
            {
                Shader.DisableKeyword("_MOBILESHADOW_ON");
                Shader.DisableKeyword("_MOBILEFADE_ON");
                return;
            }

            UpdateFade();

            if (isUsePlanShadow)
            {
                Shader.DisableKeyword("_MOBILESHADOW_ON");
                return;
            }

            Shader.EnableKeyword("_MOBILESHADOW_ON");
            if (_sunTransform == null)
            {
                Init();
                return;
            }

            UpdateFocus();
            if ((int)TextureSize != _shadowTexture.width)
            {
                AllocateNewTexture();
            }

            Shader.SetGlobalVector("_MobileShadowDir", _shadowCamera.transform.forward);
            _shadowCamera.Render();
        }
Example #2
0
        protected virtual void Awake()
        {
            appSetting = BaseAppSetting.GetInstance();
            Shader.DisableKeyword("_SNOW_ON");
            Shader.DisableKeyword("_RAIN_ON");
            Shader.SetGlobalFloat("WeatherConver", 0);
            Shader.SetGlobalColor("WeatherColor", Color.white);
            Shader.SetGlobalFloat("Gloss", 0);
            _currentRainColor = Color.white;

            rainParms.init(this);
            snowParms.init(this);
            fineParms.init(this);

            snowParms.Gloss = 0;

            CurrentWeatherType = WeatherType.Fine;
            OldWeatherType     = WeatherType.Fine;
        }