Files
zeling_v2/Assets/_Game/Scripts/World/Liquid/LiquidPhysicsConfigSO.cs

38 lines
1.7 KiB
C#
Raw Permalink 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.
// Assets/Scripts/World/Liquid/LiquidPhysicsConfigSO.cs
using UnityEngine;
using UnityEngine.Rendering;
namespace BaseGames.World.Liquid
{
[CreateAssetMenu(menuName = "BaseGames/World/LiquidPhysicsConfig")]
public class LiquidPhysicsConfigSO : ScriptableObject
{
[Header("水下物理")]
[Range(0f, 1f)]
public float GravityScale = 0.3f; // 水下重力系数(越小越漂浮)
[Range(0f, 1f)]
public float BuoyancyForce = 0.5f; // 上浮力(每帧施加的向上力)
public float MaxSwimSpeed = 4.0f; // 最大游泳速度 (m/s)
public float SwimAcceleration = 8.0f; // 游泳加速度
public float SurfaceExitSpeed = 5.0f; // 跃出水面时的冲量
public float SinkSpeed = 2.0f; // 无游泳能力时自然下沉速度 (m/s)
public float DiveSpeedMultiplier = 1.5f; // 主动下潜时的速度倍率
[Header("浅水/泥水速度缩放")]
[Range(0.1f, 1.0f)]
public float ShallowSpeedScale = 0.65f; // ShallowWater 类型水平移动速度倍率
[Range(0.1f, 1.0f)]
public float MudSpeedScale = 0.50f; // Mud 类型水平移动速度倍率
[Header("溺死计时(无游泳能力时)")]
public float DrownTime = 3.0f; // 屏气倒计时(秒),倒计时结束则触发死亡
[Header("进出液体")]
public float SplashEntryDelay = 0.05f; // 溅水特效延迟(配合动画)
public float DragCoefficient = 3.0f; // 水下阻力系数(减缓水平移动)
[Header("视觉")]
public VolumeProfile WaterVolumeProfile; // 水下后处理 Profile可为 null
}
}