Ejemplo n.º 1
0
 private void OnEnable()
 {
     if (GameLevelManager.IsPostProcessReachQuality(1000) && this.m_DepthOfFieldOfUI == null)
     {
         this.m_DepthOfFieldOfUI = CamerasMgr.CameraUI.get_gameObject().AddComponent <DepthOfFieldOfUI>();
     }
 }
Ejemplo n.º 2
0
 public void EnableLocalHeatDistortion(bool isOn)
 {
     if (isOn)
     {
         if (GameLevelManager.IsPostProcessReachQuality(250))
         {
             if (CamerasMgr.MainCameraRoot == null)
             {
                 return;
             }
             EventDispatcher.Broadcast <bool, RTManager.RtType>("RTManager.ENABLE_PROJECTION_TYPE", true, RTManager.RtType.LocalHeatDistortion);
             if (this.m_LocalHeatDistortion == null)
             {
                 this.m_LocalHeatDistortion = CamerasMgr.MainCameraRoot.get_gameObject().AddMissingComponent <LocalHeatDistortion>();
                 this.m_LocalHeatDistortion.Initialization();
                 this.m_LocalHeatDistortion.set_enabled(isOn);
             }
         }
     }
     else
     {
         EventDispatcher.Broadcast <bool, RTManager.RtType>("RTManager.ENABLE_PROJECTION_TYPE", false, RTManager.RtType.LocalHeatDistortion);
         if (this.m_LocalHeatDistortion != null)
         {
             this.m_LocalHeatDistortion.set_enabled(false);
         }
     }
 }
Ejemplo n.º 3
0
    private void EnableBloom(bool isOn)
    {
        if (CamerasMgr.MainCameraRoot == null)
        {
            return;
        }
        int lod = 250;

        if (Application.get_platform() == 11)
        {
            lod = 300;
        }
        else if (Application.get_platform() == 8)
        {
            lod = 300;
        }
        if (isOn && GameLevelManager.IsPostProcessReachQuality(lod) && SystemConfig.PP_BloomOn)
        {
            if (this.m_BloomOptimized == null)
            {
                this.m_BloomOptimized = CamerasMgr.MainCameraRoot.get_gameObject().AddComponent <BloomOptimized>();
            }
            this.m_BloomOptimized.set_enabled(isOn);
            this.m_BloomOptimized.Initialization();
        }
        else if (this.m_BloomOptimized != null)
        {
            this.m_BloomOptimized.set_enabled(false);
        }
    }
Ejemplo n.º 4
0
 private void EnableMotionBlurSimple(bool isOn, Vector3 pos)
 {
     if (CamerasMgr.MainCameraRoot == null)
     {
         return;
     }
     if (SystemInfo.get_deviceModel().Contains("M3"))
     {
         return;
     }
     if (isOn && SystemConfig.PP_MotionBlurOn)
     {
         if (GameLevelManager.IsPostProcessReachQuality(250))
         {
             if (this.m_PP_RadialBlur == null)
             {
                 this.m_PP_RadialBlur = CamerasMgr.MainCameraRoot.get_gameObject().AddComponent <PP_RadialBlur>();
             }
             this.m_PP_RadialBlur.set_enabled(isOn);
             this.m_PP_RadialBlur.Initialization(pos);
         }
     }
     else if (this.m_PP_RadialBlur != null)
     {
         this.m_PP_RadialBlur.set_enabled(false);
     }
 }
Ejemplo n.º 5
0
 private void EnableRain(bool bEnable)
 {
     if (GameLevelManager.IsPostProcessReachQuality(250) && RainEffectManager.Instance != null)
     {
         RainEffectManager.Instance.EnableRain(bEnable);
     }
 }
Ejemplo n.º 6
0
    private void Lightning(RenderTexture srcRt, RenderTexture dstRt)
    {
        this.m_fAddIntensity = Mathf.Clamp01(this.m_fAddIntensity - Time.get_deltaTime() * 2.75f);
        RenderTexture temporary  = RenderTexture.GetTemporary(srcRt.get_width() / 4, srcRt.get_height() / 4, 0, PostProcessBase.RTFormat);
        RenderTexture temporary2 = RenderTexture.GetTemporary(srcRt.get_width() / 4, srcRt.get_height() / 4, 0, PostProcessBase.RTFormat);

        this.m_matBloom.SetColor(ShaderPIDManager._ColorMix, this.m_colorMix);
        this.m_matBloom.SetVector(ShaderPIDManager._Parameter, new Vector4(this.m_colorMixBlend * 0.25f, 0f, 0f, 1f - this.m_fInitIntensity - this.m_fAddIntensity));
        Graphics.Blit(srcRt, temporary, this.m_matBloom, (this.m_fAddIntensity >= 0.5f) ? 5 : 1);
        Graphics.Blit(temporary, temporary2, this.m_matBloom, 2);
        Graphics.Blit(temporary2, temporary, this.m_matBloom, 3);
        this.m_matBloom.SetTexture("_Bloom", temporary);
        Graphics.Blit(srcRt, dstRt, this.m_matBloom, (!GameLevelManager.IsPostProcessReachQuality(250)) ? 0 : 4);
        RenderTexture.ReleaseTemporary(temporary);
        RenderTexture.ReleaseTemporary(temporary2);
    }
Ejemplo n.º 7
0
 protected override void OnEnable()
 {
     if (GameLevelManager.IsPostProcessReachQuality(1000))
     {
         base.OnEnable();
         this.IsDestoryOnDisable = true;
         Camera expr_22 = base.GetComponent <Camera>();
         expr_22.set_depthTextureMode(expr_22.get_depthTextureMode() | 1);
         this.GetMaterials();
         if (this.focalTransform == null)
         {
             GameObject gameObject = new GameObject("FocusTransform");
             gameObject.get_transform().SetParent(CamerasMgr.MainCameraRoot);
             gameObject.get_transform().set_localPosition(Vector3.get_zero());
             gameObject.get_transform().set_localRotation(Quaternion.get_identity());
             gameObject.get_transform().set_localScale(Vector3.get_one());
             this.focalTransform = gameObject.get_transform();
         }
     }
 }
Ejemplo n.º 8
0
 private void EnableScreenHeatDistortion(bool isOn)
 {
     if (isOn)
     {
         if (GameLevelManager.IsPostProcessReachQuality(250))
         {
             if (CamerasMgr.MainCameraRoot == null)
             {
                 return;
             }
             this.m_ScreenHeatDistortion = CamerasMgr.MainCameraRoot.get_gameObject().AddMissingComponent <ScreenHeatDistortion>();
             this.m_ScreenHeatDistortion.set_enabled(true);
             this.m_ScreenHeatDistortion.Initialization();
         }
     }
     else if (this.m_ScreenHeatDistortion != null)
     {
         this.m_ScreenHeatDistortion.set_enabled(false);
     }
 }
Ejemplo n.º 9
0
 private void EnableVignetteOfRT(bool bEnable)
 {
     if (bEnable)
     {
         if (GameLevelManager.IsPostProcessReachQuality(250))
         {
             if (CamerasMgr.MainCameraRoot == null)
             {
                 return;
             }
             this.m_VignetteOfRT = CamerasMgr.MainCameraRoot.get_gameObject().AddMissingComponent <PP_VignetteOfRT>();
             this.m_VignetteOfRT.set_enabled(bEnable);
             this.m_VignetteOfRT.Initialization();
         }
     }
     else if (this.m_VignetteOfRT != null)
     {
         this.m_VignetteOfRT.set_enabled(false);
     }
 }
Ejemplo n.º 10
0
 private void EnableFullScreenGray(bool isOn)
 {
     if (CamerasMgr.MainCameraRoot == null)
     {
         return;
     }
     if (isOn)
     {
         if (GameLevelManager.IsPostProcessReachQuality(250))
         {
             this.m_fullScreenGray = CamerasMgr.MainCameraRoot.get_gameObject().AddMissingComponent <FullScreenGray>();
             this.m_fullScreenGray.set_enabled(true);
             this.m_fullScreenGray.Initialization();
         }
     }
     else if (this.m_fullScreenGray != null)
     {
         this.m_fullScreenGray.set_enabled(false);
     }
 }
Ejemplo n.º 11
0
 private void EnableBGBlurFadeIn(bool bEnable)
 {
     if (bEnable)
     {
         if (GameLevelManager.IsPostProcessReachQuality(250))
         {
             if (CamerasMgr.MainCameraRoot == null)
             {
                 return;
             }
             this.m_mobileBlurBlurryFade = CamerasMgr.MainCameraRoot.get_gameObject().AddMissingComponent <MobileBlurBlurryFade>();
             this.m_mobileBlurBlurryFade.set_enabled(bEnable);
             this.m_mobileBlurBlurryFade.Initialization();
         }
     }
     else if (this.m_mobileBlurBlurryFade != null)
     {
         this.m_mobileBlurBlurryFade.set_enabled(false);
     }
 }
Ejemplo n.º 12
0
 private void EnableVignette(bool isOn)
 {
     if (CamerasMgr.MainCameraRoot == null)
     {
         return;
     }
     if (isOn)
     {
         if (GameLevelManager.IsPostProcessReachQuality(250))
         {
             if (this.m_PP_Vignette == null)
             {
                 this.m_PP_Vignette = CamerasMgr.MainCameraRoot.get_gameObject().AddComponent <PP_Vignette>();
             }
             this.m_PP_Vignette.set_enabled(isOn);
             this.m_PP_Vignette.Initialization();
         }
     }
     else if (this.m_PP_Vignette != null)
     {
         this.m_PP_Vignette.set_enabled(false);
     }
 }
Ejemplo n.º 13
0
 private void EnableScreenWater(bool isOn, bool bDisableFirst = true)
 {
     if (bDisableFirst)
     {
         this.DisableScreenEffect();
     }
     if (isOn)
     {
         if (GameLevelManager.IsPostProcessReachQuality(300))
         {
             if (CamerasMgr.MainCameraRoot == null)
             {
                 return;
             }
             this.m_waterEffect = CamerasMgr.MainCameraRoot.get_gameObject().AddMissingComponent <WaterEffect>();
             this.m_waterEffect.Initialization();
             this.m_waterEffect.set_enabled(true);
         }
     }
     else if (this.m_waterEffect != null)
     {
         this.m_waterEffect.set_enabled(false);
     }
 }
Ejemplo n.º 14
0
 private void EnableCameraRotateBlurCulling(bool isOn, float angleEffect)
 {
     if (isOn)
     {
         if (GameLevelManager.IsPostProcessReachQuality(250))
         {
             if (CamerasMgr.MainCameraRoot == null)
             {
                 return;
             }
             if (this.m_MobileBlurBlurryCulling == null)
             {
                 this.m_MobileBlurBlurryCulling = CamerasMgr.MainCameraRoot.get_gameObject().AddComponent <MobileBlurBlurryCulling>();
             }
             this.m_MobileBlurBlurryCulling.Initialization();
             this.m_MobileBlurBlurryCulling.set_enabled(true);
             this.m_MobileBlurBlurryCulling.BlurOnOff(true, angleEffect);
         }
     }
     else if (this.m_MobileBlurBlurryCulling != null)
     {
         this.m_MobileBlurBlurryCulling.BlurOnOff(false, angleEffect);
     }
 }
Ejemplo n.º 15
0
    private void EnableLightning(bool isOn, float fLightningRandom = 10f)
    {
        if (CamerasMgr.MainCameraRoot == null)
        {
            return;
        }
        int lod = 250;

        if (Application.get_platform() == 11)
        {
            lod = 300;
        }
        if (isOn && GameLevelManager.IsPostProcessReachQuality(lod))
        {
            this.m_mobileBloom = CamerasMgr.MainCameraRoot.get_gameObject().AddMissingComponent <MobileBloom>();
            this.m_mobileBloom.set_enabled(true);
            this.m_mobileBloom.m_fLightningRandom = fLightningRandom;
            this.m_mobileBloom.Initialization(MobileBloom.BloomType.Lightning);
        }
        else if (this.m_mobileBloom != null)
        {
            this.m_mobileBloom.set_enabled(false);
        }
    }
Ejemplo n.º 16
0
 private bool EnableSRDepthOfField(bool isOn)
 {
     return(!GameLevelManager.IsPostProcessReachQuality(1000) && false);
 }