StationObscurum/Assets/Packages/Heat - Complete Modern UI/Scripts/UI Manager/UIManagerAudioEditor.cs
2024-02-01 22:45:59 -05:00

48 lines
2.0 KiB
C#

#if UNITY_EDITOR
using UnityEngine;
using UnityEditor;
namespace Michsky.UI.Heat
{
[CanEditMultipleObjects]
[CustomEditor(typeof(UIManagerAudio))]
public class UIManagerAudioEditor : Editor
{
private UIManagerAudio uimaTarget;
private GUISkin customSkin;
private void OnEnable()
{
uimaTarget = (UIManagerAudio)target;
if (EditorGUIUtility.isProSkin == true) { customSkin = HeatUIEditorHandler.GetDarkEditor(customSkin); }
else { customSkin = HeatUIEditorHandler.GetLightEditor(customSkin); }
}
public override void OnInspectorGUI()
{
var UIManagerAsset = serializedObject.FindProperty("UIManagerAsset");
var audioMixer = serializedObject.FindProperty("audioMixer");
var audioSource = serializedObject.FindProperty("audioSource");
var masterSlider = serializedObject.FindProperty("masterSlider");
var musicSlider = serializedObject.FindProperty("musicSlider");
var SFXSlider = serializedObject.FindProperty("SFXSlider");
var UISlider = serializedObject.FindProperty("UISlider");
HeatUIEditorHandler.DrawHeader(customSkin, "Core Header", 6);
HeatUIEditorHandler.DrawProperty(UIManagerAsset, customSkin, "UI Manager");
HeatUIEditorHandler.DrawProperty(audioMixer, customSkin, "Audio Mixer");
HeatUIEditorHandler.DrawProperty(audioSource, customSkin, "Audio Source");
HeatUIEditorHandler.DrawProperty(masterSlider, customSkin, "Master Slider");
HeatUIEditorHandler.DrawProperty(musicSlider, customSkin, "Music Slider");
HeatUIEditorHandler.DrawProperty(SFXSlider, customSkin, "SFX Slider");
HeatUIEditorHandler.DrawProperty(UISlider, customSkin, "UI Slider");
if (Application.isPlaying == true)
return;
serializedObject.ApplyModifiedProperties();
}
}
}
#endif