41 lines
1.3 KiB
C#
41 lines
1.3 KiB
C#
using System;
|
|
using AlicizaX.Editor;
|
|
using AlicizaX.EventKit.Runtime;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace AlicizaX.EventKit.Editor
|
|
{
|
|
[CustomEditor(typeof(EventPublisherSetting))]
|
|
internal sealed class EventPublisherComponentInspector : GameFrameworkInspector
|
|
{
|
|
private const string Define = "Event_StrickCheck";
|
|
private bool hasDefine;
|
|
|
|
public override void OnInspectorGUI()
|
|
{
|
|
base.OnInspectorGUI();
|
|
serializedObject.Update();
|
|
EventPublisherSetting t = (EventPublisherSetting)target;
|
|
|
|
EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
|
|
{
|
|
bool enableStrictCheck = EditorGUILayout.Toggle("Enable Strict Check", hasDefine);
|
|
if (enableStrictCheck != hasDefine)
|
|
{
|
|
hasDefine = true;
|
|
ScriptingDefineSymbols.AddScriptingDefineSymbol(Define);
|
|
}
|
|
}
|
|
EditorGUI.EndDisabledGroup();
|
|
|
|
serializedObject.ApplyModifiedProperties();
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
hasDefine = ScriptingDefineSymbols.HasScriptingDefineSymbol(BuildTargetGroup.Standalone, Define);
|
|
}
|
|
}
|
|
}
|