using UnityEngine; using System; using System.Collections.Generic; // You call it like this : WaveExploPostProcessing.Get().StartIt(myVector2Position); public class WaveExploPostProcessing : MonoBehaviour { public Material mat; public WaveExploPostProcessing() { mat=new Material(Shader.Find("Custom/WaveExplo")); } protected float _radius; public float radius { get { return _radius; } set { _radius=value; mat.SetFloat("_Radius",_radius); } } public void StartIt(Vector2 center) { mat.SetFloat("_CenterX",(center.x+Futile.screen.halfWidth)/Futile.screen.width); mat.SetFloat("_CenterY",(center.y+Futile.screen.halfHeight)/Futile.screen.height); radius=0f; GoTweenConfig config=new GoTweenConfig().floatProp("radius",1.34f); //config.easeType=GoEaseType.ExpoOut; config.onComplete(HandleComplete); Go.to(this,0.6f,config); } protected void HandleComplete(AbstractGoTween tween) { Destroy(this); } static WaveExploPostProcessing _postProcessing; static public WaveExploPostProcessing Get() { WaveExploPostProcessing postProcessing=Futile.instance.camera.gameObject.AddComponent(); return postProcessing; } void OnRenderImage(RenderTexture src, RenderTexture dest) { Graphics.Blit(src, dest, mat); } }