diff options
author | chai <chaifix@163.com> | 2021-05-26 19:27:38 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-05-26 19:27:38 +0800 |
commit | 117938ecaece43c584ee74723a36d8dc2f2a4ae1 (patch) | |
tree | cbfe7c6d25bc633163a22b5e1016cc1d5487236c /Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs | |
parent | b9fe2ce418667724c3e3fdedd228ff2691900bbe (diff) |
+Tween Animation
Diffstat (limited to 'Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs')
-rw-r--r-- | Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs | 75 |
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 |