using UnityEditor; using UnityEditor.SceneManagement; using UnityEngine; namespace Superlazy.UI { [CanEditMultipleObjects] [CustomEditor(typeof(SLUIFade))] public class SLUIFadeEditor : Editor { private SLUIFade component; private void OnEnable() { component = target as SLUIFade; } public override void OnInspectorGUI() { component.fadeInTime = EditorGUILayout.FloatField("Fade In(On) Time", component.fadeInTime); component.fadeOutTime = EditorGUILayout.FloatField("Fade Out(Off) Time", component.fadeOutTime); component.ViewEntity(); if (GUI.changed && Application.isPlaying == false) { EditorUtility.SetDirty(component); EditorSceneManager.MarkAllScenesDirty(); } } } }