Files
Fishing2/Assets/Scripts/Test/FlatWaterHeightProvider.cs
2026-02-26 17:58:34 +08:00

16 lines
442 B
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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;
}