Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Reflection;
- using UnityEditor;
- using UnityEditor.UI;
- using UnityEngine;
- [CustomEditor(typeof(ScenarioView))]
- public class ScenarioViewInspector : ButtonEditor
- {
- private static readonly Type type = typeof(ScenarioView);
- public override void OnInspectorGUI()
- {
- //DrawDefaultInspector();
- MyOnInspectorGUI();
- }
- private void MyOnInspectorGUI()
- {
- serializedObject.Update();
- base.OnInspectorGUI();
- var iterator = serializedObject.GetIterator();
- iterator.Next(true);
- while (iterator.NextVisible(true))
- {
- if ((iterator.name != "m_Script") && (type.GetField(iterator.propertyPath, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly) != null))
- EditorGUILayout.PropertyField(iterator);
- }
- serializedObject.ApplyModifiedProperties();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement