mirror of
https://github.com/Dadechin/Unity-WebSocket.git
synced 2025-07-04 04:14:34 +00:00
59 lines
1.9 KiB
C#
59 lines
1.9 KiB
C#
#if UNITY_EDITOR
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
using static FishNet.Component.ColliderRollback.ColliderRollback;
|
|
|
|
namespace FishNet.Component.ColliderRollback
|
|
{
|
|
|
|
[CustomEditor(typeof(ColliderRollback), true)]
|
|
[CanEditMultipleObjects]
|
|
public class ColliderRollbackEditor : Editor
|
|
{
|
|
private SerializedProperty _boundingBox;
|
|
private SerializedProperty _physicsType;
|
|
private SerializedProperty _boundingBoxSize;
|
|
private SerializedProperty _colliderParents;
|
|
|
|
|
|
protected virtual void OnEnable()
|
|
{
|
|
_boundingBox = serializedObject.FindProperty(nameof(_boundingBox));
|
|
_physicsType = serializedObject.FindProperty(nameof(_physicsType));
|
|
_boundingBoxSize = serializedObject.FindProperty(nameof(_boundingBoxSize));
|
|
_colliderParents = serializedObject.FindProperty(nameof(_colliderParents));
|
|
}
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
serializedObject.Update();
|
|
ColliderRollback nob = (ColliderRollback)target;
|
|
|
|
GUI.enabled = false;
|
|
EditorGUILayout.ObjectField("Script:", MonoScript.FromMonoBehaviour(nob), typeof(ColliderRollback), false);
|
|
GUI.enabled = true;
|
|
|
|
EditorGUILayout.LabelField("Settings", EditorStyles.boldLabel);
|
|
EditorGUI.indentLevel++;
|
|
|
|
EditorGUILayout.PropertyField(_boundingBox);
|
|
if ((BoundingBoxType)_boundingBox.intValue != BoundingBoxType.Disabled)
|
|
{
|
|
EditorGUI.indentLevel++;
|
|
EditorGUILayout.PropertyField(_physicsType);
|
|
EditorGUILayout.PropertyField(_boundingBoxSize);
|
|
EditorGUI.indentLevel--;
|
|
}
|
|
EditorGUILayout.PropertyField(_colliderParents);
|
|
|
|
EditorGUI.indentLevel--;
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
#endif |