SanAndreasUnity/Assets/Scripts/Editor/WaterFaceInfoInspector.cs
2022-02-27 18:34:29 +01:00

32 lines
904 B
C#

using SanAndreasUnity.Behaviours.World;
using UnityEditor;
using UnityEngine;
namespace SanAndreasUnity.Editor
{
[CustomEditor(typeof(WaterFaceInfo))]
public class WaterFaceInfoInspector : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
base.DrawDefaultInspector();
GUILayout.Space(10);
GUILayout.Label("Info:");
GUILayout.Space(10);
var waterFaceInfo = (WaterFaceInfo)this.target;
if (waterFaceInfo.WaterFace != null)
{
EditorUtils.DrawFieldsAndPropertiesInInspector(waterFaceInfo.WaterFace, 0);
foreach (var vertex in waterFaceInfo.WaterFace.Vertices)
{
GUILayout.Space(10);
EditorUtils.DrawFieldsAndPropertiesInInspector(vertex, 0);
}
}
}
}
}