summaryrefslogtreecommitdiff
path: root/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs')
-rw-r--r--Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs75
1 files changed, 75 insertions, 0 deletions
diff --git a/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs
new file mode 100644
index 0000000..f98c47d
--- /dev/null
+++ b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+
+namespace TweenAnimation
+{
+ [CustomEditor(typeof(TweenAnimation), false)]
+ public partial class TweenAnimationInspector : Editor
+ {
+
+
+ public override void OnInspectorGUI()
+ {
+ TweenAnimation tween = target as TweenAnimation;
+
+ EditorGUILayout.LabelField("Tween Alpha", TweenModuleGUIStyles.Get().moduleHeaderStyle);
+ // GUILayout.Button("button", "ProfilerBadge");
+ //DrawProObjectField<TweenAnimation>(new GUIContent(""), tween, typeof(TweenAnimation), TweenModuleGUIStyles.Get().objectField, false);
+
+ Rect rect = GUILayoutUtility.GetRect(100, 25f);
+
+ bool result = GUI.Toggle(rect, true, "content", TweenModuleGUIStyles.Get().moduleHeaderStyle);
+ rect = GUILayoutUtility.GetRect(100, 25f);
+
+ GUI.Button(rect, "", "OL Plus");
+ rect.y += 20;
+ GUI.Button(rect, "", "OL Minus");
+ }
+ public static void DrawProObjectField<T>(
+ GUIContent label,
+ SerializedProperty value,
+ Type objType,
+ GUIStyle style,
+ bool allowSceneObjects,
+ Texture objIcon = null,
+ params GUILayoutOption[] options) where T : UnityEngine.Object
+ {
+
+ T tObj = value.objectReferenceValue as T;
+
+ if (objIcon == null)
+ {
+ objIcon = EditorGUIUtility.FindTexture("PrefabNormal Icon");
+ }
+ style.imagePosition = ImagePosition.ImageLeft;
+
+ int pickerID = 455454425;
+
+ if (tObj != null)
+ {
+ EditorGUILayout.LabelField(label,
+ new GUIContent(tObj.name, objIcon), style, options);
+ }
+
+ if (GUILayout.Button("Select"))
+ {
+ EditorGUIUtility.ShowObjectPicker<T>(
+ tObj, allowSceneObjects, "", pickerID);
+
+ }
+ if (Event.current.commandName == "ObjectSelectorUpdated")
+ {
+ if (EditorGUIUtility.GetObjectPickerControlID() == pickerID)
+ {
+ tObj = EditorGUIUtility.GetObjectPickerObject() as T;
+ value.objectReferenceValue = tObj;
+ }
+ }
+
+ }
+
+ }
+} \ No newline at end of file