private void SyncByAnimation() { base.cameraPosition = this._animation.transform.position; base.cameraForward = this._animation.transform.forward; base.cameraFOV = base._owner.originalFOV; if (this._simpleAnimationComponent != null) { if (this._simpleAnimationComponent.useKeyedFOV) { base.cameraFOV = this._simpleAnimationComponent.keyedFOV; } if (this._simpleAnimationComponent.useKeyedDirectionalLightRotation) { base._owner.directionalLight.transform.rotation = this._simpleAnimationComponent.GetLightRotation(); } } if ((this._simpleAnimationComponent != null) && this._simpleAnimationComponent.useKeyedRadialBlur) { PostFX component = base._owner.GetComponent <PostFX>(); if (component != null) { component.RadialBlurCenter = this._simpleAnimationComponent.radialBlurCenter; component.RadialBlurScatterScale = this._simpleAnimationComponent.radialBlurScatterScale; component.RadialBlurStrenth = this._simpleAnimationComponent.radialBlurStrenth; } } }
public static void EnableFXAA(bool enabled) { PostFX tfx = UnityEngine.Object.FindObjectOfType <PostFX>(); if (tfx != null) { tfx.FXAA = enabled; } }
public static void EnableDistortion(bool enabled) { PostFX tfx = UnityEngine.Object.FindObjectOfType <PostFX>(); if (tfx != null) { tfx.UseDistortion = enabled; } }
public static void EnableColorGrading(bool enabled) { PostFX tfx = UnityEngine.Object.FindObjectOfType <PostFX>(); if (tfx != null) { tfx.UseColorGrading = enabled; } }
public static void EnableHDR(bool enabled) { PostFX tfx = UnityEngine.Object.FindObjectOfType <PostFX>(); if (tfx != null) { tfx.HDRBuffer = enabled; } }
private void Start() { PostFX component = Camera.main.GetComponent <PostFX>(); if (component != null) { component.WriteDepthTexture = true; } }
public static void SetPostEffectBufferSizeByQuality(Dictionary <PostEffectQualityGrade, int> postFxGradeBufferSize, PostEffectQualityGrade quality) { PostFX tfx = UnityEngine.Object.FindObjectOfType <PostFX>(); if (tfx != null) { int num = 0; postFxGradeBufferSize.TryGetValue(quality, out num); tfx.internalBufferSize = (PostFXBase.InternalBufferSizeEnum)num; } }
public static void SetPostFXContrast(float contrastDelta) { PostFX tfx = UnityEngine.Object.FindObjectOfType <PostFX>(); if (tfx != null) { if (Singleton <LevelManager> .Instance != null) { tfx.constrast = 2f + contrastDelta; } else { tfx.constrast = 2.1f + contrastDelta; } } }
private void InitPlay() { BaseMonoAvatar avatar = Singleton <AvatarManager> .Instance.TryGetLocalAvatar(); this._avatarTransform = avatar.transform; this._behaviorTree = avatar.GetComponent <BehaviorDesigner.Runtime.BehaviorTree>(); if (this.slowMode) { Time.timeScale = 0.25f; } if (!this.showEffect) { this._postFX = this._camera.GetComponent <PostFX>(); this._postFX.UseDistortion = false; } this._timer = 0f; this.isPlaying = true; }
public override void Enter() { Singleton <AvatarManager> .Instance.SetMuteAllAvatarControl(true); this._isFirstFrame = true; if (this._simpleAnimationComponent != null) { if (this._simpleAnimationComponent.initClipZNear > 0f) { base._owner.cameraComponent.nearClipPlane = Mathf.Max(0.01f, this._simpleAnimationComponent.initClipZNear); } if (this._simpleAnimationComponent.initFOV > 0f) { base._owner.cameraComponent.fieldOfView = this._simpleAnimationComponent.initFOV; } this._simpleAnimationComponent.selfUpdateKeyedRotation = false; if (this._simpleAnimationComponent.useKeyedDirectionalLightRotation) { base._owner.SetNeedLerpDirectionalLight(false); } } Singleton <MainUIManager> .Instance.GetInLevelUICanvas().mainPageContext.SetInLevelMainPageActive(false, false, true); PostFX component = base._owner.GetComponent <PostFX>(); if (component != null) { this._origRadialBlurCenter = component.RadialBlurCenter; this._origRadialBlurStrenth = component.RadialBlurStrenth; this._origRadialBlurScatterScale = component.RadialBlurScatterScale; } if (this._pauseLevel) { Singleton <LevelManager> .Instance.SetPause(true); } if (this._cullType == CameraAnimationCullingType.CullAvatars) { Singleton <AvatarManager> .Instance.SetAllAvatarVisibility(false); } if (this._levelAnimStartCallback != null) { this._levelAnimStartCallback(); } }
public override void Exit() { if (this._levelAnimEndCallback != null) { this._levelAnimEndCallback(); } if (this._animation != null) { this._animation.Stop(); UnityEngine.Object.Destroy(this._animation.gameObject); } base._owner.cameraComponent.nearClipPlane = base._owner.originalNearClip; base._owner.cameraComponent.fieldOfView = base._owner.originalFOV; if (this._simpleAnimationComponent.useKeyedRadialBlur) { this._simpleAnimationComponent.useKeyedRadialBlur = false; PostFX component = base._owner.GetComponent <PostFX>(); if (component != null) { component.RadialBlurCenter = this._origRadialBlurCenter; component.RadialBlurStrenth = this._origRadialBlurStrenth; component.RadialBlurScatterScale = this._origRadialBlurScatterScale; } } if (this._pauseLevel) { Singleton <LevelManager> .Instance.SetPause(false); } if (this._cullType == CameraAnimationCullingType.CullAvatars) { Singleton <AvatarManager> .Instance.SetAllAvatarVisibility(true); } Singleton <AvatarManager> .Instance.SetMuteAllAvatarControl(false); Singleton <MainUIManager> .Instance.GetInLevelUICanvas().mainPageContext.SetInLevelMainPageActive(true, false, true); base._owner.SetNeedLerpDirectionalLight(true); }
private void InitRecord() { this._frameTime = 1f / ((float)this.frameRate); this._frameCount = 0; if (this.duration > 0f) { this._totalFrameCount = (int)(this.duration / this._frameTime); } else { this._totalFrameCount = -1; } this._recordFrameCount = 0; this._camera = Camera.main; this._postFX = this._camera.GetComponent <PostFX>(); Time.captureFramerate = (int)(1f / this.updateDeltaTime); this._timeScale = this._frameTime / this.updateDeltaTime; Time.timeScale *= this._timeScale; if (!true) { this.EndRecord(); } }
public static void EnablePostFX(bool enabled, bool forceWhenDisable = false) { PostFX tfx = UnityEngine.Object.FindObjectOfType <PostFX>(); if (tfx != null) { if (!enabled && forceWhenDisable) { tfx.enabled = false; } else { tfx.enabled = true; tfx.OnlyResScale = !enabled; } tfx.FastMode = !enabled; tfx.originalEnabled = tfx.enabled; if (onPostFXChanged != null) { onPostFXChanged(tfx.enabled); } } }
private void SettingHDR(bool postFXEnable) { if (base.gameObject.activeSelf) { bool supportHDR = false; PostFX tfx = UnityEngine.Object.FindObjectOfType <PostFX>(); if ((tfx != null) && tfx.enabled) { supportHDR = tfx.SupportHDR; } if (!supportHDR) { this._mpb.SetFloat(OPAQUENESS_SCALER_NAME, this.opaquenessScalerWithoutHDR); this._mpb.SetFloat(EMISSION_SCALER_SCALER_NAME, this.emissionScalerScalerWithoutHDR); } else { this._mpb.SetFloat(OPAQUENESS_SCALER_NAME, this._oldOpaquenessScalerWithoutHDR); this._mpb.SetFloat(EMISSION_SCALER_SCALER_NAME, this._oldEmissionScalerScalerWithoutHDR); } this._renderer.SetPropertyBlock(this._mpb); } }
private void Awake() { this._objList = new List <GameObject>(); this._postFX = this.mainCamera.GetComponent <PostFX>(); }