32 lines
873 B (Stored with Git LFS)
C#
32 lines
873 B (Stored with Git LFS)
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();
|
|
}
|
|
}
|
|
}
|
|
} |