コード例 #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();
        }
コード例 #2
0
 public static BaseAppSetting GetInstance()
 {
     if (ins == null)
     {
         ins = new BaseAppSetting();
     }
     return(ins);
 }
コード例 #3
0
        public BaseAppSetting()
        {
            if (ins != null)
            {
                throw new Exception("BaseAppSetting Singleton already constructed!");
            }

            ins = this;

            defaultInit();
        }
コード例 #4
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;
        }