コード例 #1
0
    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;
        }
    }
コード例 #2
0
    IEnumerator CaptureBlurTexture()
    {
        Clear();
        oldBG.SetActive(true);
        RapidBlurEffect.RenderStart();
        yield return(new WaitForEndOfFrame());

        CaptureCamera();
        RapidBlurEffect.RenderEnd();
        oldBG.SetActive(false);
    }
コード例 #3
0
    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;
    }
コード例 #4
0
 void OnDestroy()
 {
     m_Singleton = null;
 }
コード例 #5
0
 void Awake()
 {
     m_Singleton = this;
 }