using UnityEditor; using UnityEngine; using VketCloudGUITools.Runtime; namespace VketCloudGUITools.Editor { [CustomEditor(typeof(SoundMixerGUIAction))] public class SoundMixerActionInspector : GUIActionInspector { GUIActionEditorRectHelpder _helper = null; public override void OnSubInspectorGUI(Rect position) { var action = target as SoundMixerGUIAction; _helper = new GUIActionEditorRectHelpder(position); Rect typeRect, checkRect, content1Rect, content2Rect; _helper.GetTypeRectAndCheckRect(out typeRect, out checkRect); content1Rect = _helper.ContentRect(1); content2Rect = _helper.ContentRect(1); using (new GUI.GroupScope(position, GUI.skin.box)) { // Action Name DrawActionNameTypeFieldDummy(checkRect, typeRect, action.FuncName); // Volume Mute Flag var oldVolumeMuteFlag = action.VolumeMuteFlag; var newVolumeMuteFlag = EditorGUI.Toggle(content1Rect, "Volume Mute Flag", oldVolumeMuteFlag); if (newVolumeMuteFlag != oldVolumeMuteFlag) { Undo.RecordObject(action, "GUI Action"); action.VolumeMuteFlag = newVolumeMuteFlag; } } } public override float GetSubInspectorHeight() => EditorGUIUtility.singleLineHeight * 2; } }