ProjectDDD/Packages/SLUnity/Editor/SLUI/SLUIFadeEditor.cs
2025-07-08 19:46:31 +09:00

32 lines
873 B
C#

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();
}
}
}
}