Add water system package

This commit is contained in:
Vova
2023-12-06 20:29:45 +02:00
parent 627a90012a
commit 58d0f79bd1
140 changed files with 33167 additions and 3 deletions
@@ -0,0 +1,45 @@
using UnityEditor;
namespace WaterSystem
{
[CustomEditor(typeof(BuoyantObject))]
public class BuoyantObjectEditor : Editor
{
private BuoyantObject obj;
private bool _heightsDebugBool;
private bool _generalSettingsBool;
private void OnEnable()
{
obj = serializedObject.targetObject as BuoyantObject;
}
public override void OnInspectorGUI()
{
_generalSettingsBool = EditorGUILayout.BeginFoldoutHeaderGroup(_generalSettingsBool, "General Settings");
if (_generalSettingsBool)
{
base.OnInspectorGUI();
}
EditorGUILayout.EndFoldoutHeaderGroup();
_heightsDebugBool = EditorGUILayout.BeginFoldoutHeaderGroup(_heightsDebugBool, "Height Debug Values");
if (_heightsDebugBool)
{
if (obj.Heights != null)
{
for (var i = 0; i < obj.Heights.Length; i++)
{
var h = obj.Heights[i];
EditorGUILayout.LabelField($"{i})Wave(heights):", $"X:{h.x:00.00} Y:{h.y:00.00} Z:{h.z:00.00}");
}
}
else
{
EditorGUILayout.HelpBox("Height debug info only available in playmode.", MessageType.Info);
}
}
EditorGUILayout.EndFoldoutHeaderGroup();
}
}
}