private void Update() { updateTime += Time.deltaTime; if (updateTime < updateInterval) { return; } updateTime = 0f; blurVal += dir; if (dir > 0) { if (blurVal >= maxBlurVal) { blurVal = maxBlurVal; } } else { if (blurVal <= 0) { Destroy(effect); effect = null; } } if (effect != null) { effect.BlurIterations = blurVal; } }
IEnumerator CaptureBlurTexture() { Clear(); oldBG.SetActive(true); RapidBlurEffect.RenderStart(); yield return(new WaitForEndOfFrame()); CaptureCamera(); RapidBlurEffect.RenderEnd(); oldBG.SetActive(false); }
public void StartBlur() { if (effect == null) { effect = InGameManager.GetInstance().gamecamera.gameObject.AddComponent <RapidBlurEffect>(); } blurVal = 0; effect.BlurSpreadSize = 0; effect.DownSampleNum = 0; effect.BlurIterations = blurVal; dir = 1; }
void OnDestroy() { m_Singleton = null; }
void Awake() { m_Singleton = this; }