基础内容
必要插件安装 缓动曲线和动画基础 ElementFolder,Track与其次级模块,PathNode重构
This commit is contained in:
47
Assets/Modern UI Pack/Scripts/Icon/IconLibraryEditor.cs
Normal file
47
Assets/Modern UI Pack/Scripts/Icon/IconLibraryEditor.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Michsky.MUIP
|
||||
{
|
||||
[CustomEditor(typeof(IconLibrary))]
|
||||
public class IconLibraryEditor : Editor
|
||||
{
|
||||
private GUISkin customSkin;
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
if (EditorGUIUtility.isProSkin == true) { customSkin = MUIPEditorHandler.GetDarkEditor(customSkin); }
|
||||
else { customSkin = MUIPEditorHandler.GetLightEditor(customSkin); }
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
// Settings
|
||||
var alwaysUpdate = serializedObject.FindProperty("alwaysUpdate");
|
||||
var optimizeUpdates = serializedObject.FindProperty("optimizeUpdates");
|
||||
|
||||
MUIPEditorHandler.DrawHeader(customSkin, "Options Header", 8);
|
||||
alwaysUpdate.boolValue = MUIPEditorHandler.DrawToggle(alwaysUpdate.boolValue, customSkin, "Always Update");
|
||||
optimizeUpdates.boolValue = MUIPEditorHandler.DrawToggle(optimizeUpdates.boolValue, customSkin, "Optimize Update");
|
||||
|
||||
// Content
|
||||
var icons = serializedObject.FindProperty("icons");
|
||||
|
||||
MUIPEditorHandler.DrawHeader(customSkin, "Content Header", 8);
|
||||
GUILayout.BeginVertical(EditorStyles.helpBox);
|
||||
EditorGUI.indentLevel = 1;
|
||||
EditorGUILayout.PropertyField(icons, new GUIContent("Icon List"), true);
|
||||
EditorGUI.indentLevel = 0;
|
||||
|
||||
if (GUILayout.Button("+ Add a new icon", customSkin.button))
|
||||
icons.arraySize += 1;
|
||||
|
||||
GUILayout.EndVertical();
|
||||
|
||||
if (Application.isPlaying == false) { this.Repaint(); }
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user