16 lines
442 B
C#
16 lines
442 B
C#
using UnityEngine;
|
||
|
||
public interface IWaterHeightProvider
|
||
{
|
||
/// <summary>返回 worldPos 位置的水面高度(Y)</summary>
|
||
float GetWaterHeight(Vector3 worldPos);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 最简单的水面:固定平面(适合先跑通逻辑)
|
||
/// </summary>
|
||
public class FlatWaterHeightProvider : MonoBehaviour, IWaterHeightProvider
|
||
{
|
||
public float waterY = 0f;
|
||
public float GetWaterHeight(Vector3 worldPos) => waterY;
|
||
} |