c# 代码
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WaterWaveEffect : MonoBehaviour
{
//距离系数
public float distanceFactor = 60.0f;
//时间系数
public float timeFactor = -30.0f;
//sin函数结果系数
public float totalFactor = 1.0f;
//波纹宽度
public float waveWidth = 0.3f;
//波纹扩散的速度
public float waveSpeed = 0.3f;
private float waveStartTime;
private Vector4 startPos = new Vector4(0.5f, 0.5f, 0, 0);
public Material _Material;
/// <summary>
/// 在所有渲染完成后调用
/// </summary>
/// <param name="source"></param>
/// <param name="destination"></param>
void OnRenderImage(RenderTexture source, RenderTexture destination)
{
Debug.Log("波纹");
//计算波纹移动的距离,根据enable到目前的时间*速度求解
float curWaveDistance = (Time.time - waveStartTime) * waveSpeed;