Add water system package
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
|
||||
namespace WaterSystem.Data
|
||||
{
|
||||
[CustomEditor(typeof(WaterSettingsData))]
|
||||
public class WaterSettingsDataEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
var geomType = serializedObject.FindProperty("waterGeomType");
|
||||
EditorGUILayout.PropertyField(geomType);
|
||||
|
||||
var refType = serializedObject.FindProperty("refType");
|
||||
refType.enumValueIndex = GUILayout.Toolbar(refType.enumValueIndex, refType.enumDisplayNames);
|
||||
|
||||
switch(refType.enumValueIndex)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
// cubemap
|
||||
var cube = serializedObject.FindProperty("cubemapRefType");
|
||||
EditorGUILayout.PropertyField(cube, new GUIContent("Cubemap Texture"));
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
// probe
|
||||
EditorGUILayout.HelpBox("Reflection Probe setting has no options, it automatically uses the nearest reflection probe to the main camera", MessageType.Info);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
// planar
|
||||
var planarSettings = serializedObject.FindProperty("planarSettings");
|
||||
EditorGUILayout.PropertyField(planarSettings, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user