using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
[ExecuteAlways]
|
|
public class ApplyImageEffect : MonoBehaviour
|
|
{
|
|
|
|
[SerializeField]
|
|
private Shader m_imageEffect;
|
|
|
|
[SerializeField]
|
|
private Material m_mat;
|
|
|
|
private void Awake()
|
|
{
|
|
|
|
if (m_imageEffect != null && m_mat == null)
|
|
{
|
|
m_mat = new Material(m_imageEffect);
|
|
}
|
|
}
|
|
|
|
private void OnRenderImage(RenderTexture source, RenderTexture destination)
|
|
{
|
|
if (m_mat != null)
|
|
{
|
|
Graphics.Blit(source, destination, m_mat);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|