rabidus-test/Assets/Dreamteck/Splines/Editor/Components/EdgeColliderGeneratorEditor.cs

34 lines
1.1 KiB
C#
Raw Permalink Normal View History

2023-07-24 16:38:13 +03:00
namespace Dreamteck.Splines.Editor
{
using UnityEngine;
using System.Collections;
using UnityEditor;
[CustomEditor(typeof(EdgeColliderGenerator))]
[CanEditMultipleObjects]
public class EdgeColliderGeneratorEditor : SplineUserEditor
{
protected override void BodyGUI()
{
base.BodyGUI();
EdgeColliderGenerator generator = (EdgeColliderGenerator)target;
serializedObject.Update();
SerializedProperty offset = serializedObject.FindProperty("_offset");
SerializedProperty updateRate = serializedObject.FindProperty("updateRate");
EditorGUILayout.Space();
EditorGUILayout.LabelField("Polygon", EditorStyles.boldLabel);
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(offset, new GUIContent("Offset"));
EditorGUILayout.PropertyField(updateRate);
if (updateRate.floatValue < 0f) updateRate.floatValue = 0f;
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
}
}
}
}