public override void Enter(Action _action, Track _track) { if (!GameSettings.AllowRadialBlur) { return; } this.cameras = Object.FindObjectsOfType <Camera>(); if (this.cameras == null) { return; } int mask = LayerMask.GetMask(new string[] { "Scene" }); for (int i = 0; i < this.cameras.Length; i++) { Camera camera = this.cameras[i]; if ((camera.cullingMask & mask) != 0) { RadialBlur radialBlur = camera.GetComponent <RadialBlur>(); if (radialBlur == null) { radialBlur = camera.gameObject.AddComponent <RadialBlur>(); } radialBlur.blurScale = this.blurScale; radialBlur.falloffExp = this.falloffExp; radialBlur.UpdateParameters(); } } }
public override void Leave(Action _action, Track _track) { if (this.cameras == null) { return; } int mask = LayerMask.GetMask(new string[] { "Scene" }); for (int i = 0; i < this.cameras.Length; i++) { Camera camera = this.cameras[i]; if (!(camera == null) && (camera.cullingMask & mask) != 0) { RadialBlur component = camera.GetComponent <RadialBlur>(); if (component) { Object.Destroy(component); } } } this.cameras = null; }
public override void Enter(Action _action, Track _track) { if (GameSettings.AllowRadialBlur) { this.cameras = UnityEngine.Object.FindObjectsOfType <Camera>(); if (this.cameras != null) { string[] layerNames = new string[] { "Scene" }; int mask = LayerMask.GetMask(layerNames); for (int i = 0; i < this.cameras.Length; i++) { Camera camera = this.cameras[i]; if ((camera.cullingMask & mask) != 0) { RadialBlur component = camera.GetComponent <RadialBlur>(); if (component == null) { component = camera.gameObject.AddComponent <RadialBlur>(); } component.blurScale = this.blurScale; component.falloffExp = this.falloffExp; component.UpdateParameters(); } } } } }
private void Awake() { if (Instance == null) { Instance = this; } //init if (cameraShake.camera) { mainCamera = cameraShake.camera; } else { mainCamera = GetComponentInChildren <CinemachineVirtualCamera>(); } noise = mainCamera.GetCinemachineComponent <CinemachineBasicMultiChannelPerlin>(); radialBlurIsOpen = false; motionVectorIsOpen = false; PPP = GetComponent <PostProcessVolume>().sharedProfile; motionBlurSetting = PPP.GetSetting <MotionBlur>(); RadialBlurSetting = PPP.GetSetting <RadialBlur>(); HitEffectSetting = PPP.GetSetting <Vignette>(); }
static void AddRadialBlur() { if (UnityEditor.Selection.activeGameObject != null) { RadialBlur comp = UnityEditor.Selection.activeGameObject.AddComponentIfNoExist <RadialBlur>(); comp.overlayShader = Shader.Find("Xffect/PP/radial_blur"); comp.target = UnityEditor.Selection.activeGameObject.transform; EditorUtil.SetDirty(comp); } }
public override void StopEvent() { foreach (var ca in Camera.allCameras) { RadialBlur rg = ca.gameObject.GetComponent <RadialBlur>(); if (rg) { UnityEngine.Object.Destroy(rg); } } }
void Awake() { Property = this.GetComponent <shuxing>(); attnum = 0; CameraEffect = Camera.main.GetComponent <RadialBlur>(); touji = Camera.main.GetComponent <toujicamera>(); player = this.transform.parent.gameObject; mymotor = this.transform.parent.GetComponent <RPGMotor>(); myAnimator = GetComponent <Animator>(); cameraTransform = Camera.main.transform; myCapCollider = GetComponent <CapsuleCollider>(); }
void Start() { pm = GetComponent <PlayerMovement>(); pv = GetComponent <PlayerVitals>(); empRestorationLabel = GeneralVariables.uiController.empRecalibrate; rBlur = GeneralVariables.uiController.guiCamera.GetComponent <RadialBlur>(); audioSource.volume = 0f; if (sunShafts != null) { camTransform = sunShafts.transform; } }
// Called when the owning graph starts playing public override void OnGraphStart(Playable playable) { PostProcessLayer postLayer = null; if (Camera.main != null) { postLayer = Camera.main.gameObject.GetComponentInChildren <PostProcessLayer>(); } if (postLayer == null) { var allCam = Camera.allCameras; foreach (var cam in allCam) { var pl = cam.gameObject.GetComponentInChildren <PostProcessLayer>(); if (pl != null) { postLayer = pl; break; } } } if (postLayer == null) { return; } PostProcessVolume volume = PostProcessManager.instance.GetHighestPriorityVolume(postLayer); PostProcessProfile profile = volume.sharedProfile; if (profile == null) { return; } blurCtrl = profile.GetSetting <RadialBlur>(); if (blurCtrl == null) { blurCtrl = profile.AddSettings <RadialBlur>(); } blurCtrl.enabled.value = true; blurCtrl.center.value = this.blurCenter; blurCtrl.center.overrideState = true; blurCtrl.centerSize.value = this.centerSize; blurCtrl.centerSize.overrideState = true; blurCtrl.blurSize.value = this.blurSizeCur.Evaluate(0f); blurCtrl.blurSize.overrideState = true; }
// Use this for initialization void Awake() { _Instance = this; IsActiveCamOtherPoint = false; mCamTran = camera.transform; RadialBlurScript = GetComponent <RadialBlur>(); RadialBlurScript.enabled = false; //CreateAudioSoureFengXue(); BlurScript = GetComponent <MotionBlur>(); BlurScript.enabled = false; InitSetPlayerSpeedRadialBlur(); //InvokeRepeating("TestCamShake", 3f, 3f); }
// Start is called before the first frame update void Start() { trans = transform; lastPosition = newPosition = trans.position; //获取对象及子对象中的所有渲染器(MeshRenderer或者SkinnedMeshRenderer) var renderers = trans.GetComponentsInChildren <Renderer> (); //获取所有的材质球(针对有些对象有多个部件多个材质的情况) mats = new Material[renderers.Length]; for (int i = 0; i < renderers.Length; i++) { mats[i] = renderers[i].sharedMaterial; } radialBlur = mainCamera.GetComponent <RadialBlur>(); }
public override bool Enter(CameraControll owner) { base.Enter(owner); if (rb && rb.enabled) { return(true); } if (!rb) { rb = owner.gameObject.AddComponent <RadialBlur>(); } rb.enabled = true; rb.Intensity = value; isdone = true; return(true); }
public IEnumerator DoRadialBlur() { RadialBlur radialBlur = tpsCam.GetComponent <RadialBlur>(); float blurStrength = 0; float toggle = 0; float interval = 0.01f; radialBlur.enabled = true; radialBlur.blurStrength = blurStrength; radialBlur.blurCenter = radialBlurCenter; while (toggle < interval) { toggle += Time.deltaTime; blurStrength = Mathf.Lerp(blurStrength, maxBlurStrength, toggle / interval); radialBlur.blurStrength = blurStrength; radialBlur.blurCenter = radialBlurCenter; yield return(new WaitForEndOfFrame()); } blurStrength = maxRadialBlurStrength; yield return(new WaitForSeconds(radialBlurTime)); toggle = 0; interval = 0.5f; while (toggle < interval) { toggle += Time.deltaTime; blurStrength = Mathf.Lerp(blurStrength, 0, toggle / interval); radialBlur.blurStrength = blurStrength; radialBlur.blurCenter = radialBlurCenter; yield return(new WaitForEndOfFrame()); } blurStrength = 0; radialBlur.blurStrength = blurStrength; radialBlur.blurCenter = radialBlurCenter; radialBlur.enabled = false; radialBlurActive = false; }
public void PlayRadialBlur(float strength, Transform t, float duration, Vector3 offset, float beginSmooth, float endSmooth) { GameObject go = GameObjectPool.GetPool(GameObjectPool.enPool.Fx).GetImmediately("fx_camera_blur_internal", false); CameraFx cameraFx = go.GetComponent <CameraFx>(); CameraAni cameraAni = cameraFx.m_anis[0]; cameraAni.m_endFloat = strength; cameraAni.m_beginDuration = beginSmooth; cameraAni.m_endDuration = endSmooth; RadialBlur blur = go.GetComponent <RadialBlur>(); blur.target = t; blur.offset = offset; go.SetActive(true); FxDestroy.Add(go, duration); }
public override void Leave(Action _action, Track _track) { if (this.cameras != null) { string[] layerNames = new string[] { "Scene" }; int mask = LayerMask.GetMask(layerNames); for (int i = 0; i < this.cameras.Length; i++) { Camera camera = this.cameras[i]; if ((camera != null) && ((camera.cullingMask & mask) != 0)) { RadialBlur component = camera.GetComponent <RadialBlur>(); if (component != null) { UnityEngine.Object.Destroy(component); } } } this.cameras = null; } }
void Start() { _radialBlur = GetComponent <RadialBlur>(); }
void OnDestroy() { instance = null; }
void Awake() { instance = this; enabled = false; }
public RadialBlurSample(Microsoft.Xna.Framework.Game game) : base(game) { _radialBlur = new RadialBlur(GraphicsService); GraphicsScreen.PostProcessors.Add(_radialBlur); }