From 9ff19bb9f048e74670b6292889edc54ae47c61fe Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 26 May 2021 22:39:25 +0800 Subject: *misc --- .../Tween/Editor/TweenAnimationInspector.cs | 66 ++++------------------ .../Animation/Tween/Editor/TweenModuleUI.cs | 13 +++++ .../Animation/Tween/Editor/TweenModuleUI.cs.meta | 11 ++++ .../Scripts/Animation/Tween/TweenAnimation.cs | 2 + .../Scripts/Animation/Tween/TweenController.cs | 2 + .../Scripts/Animation/Tween/TweenModule.cs | 3 + 6 files changed, 43 insertions(+), 54 deletions(-) create mode 100644 Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleUI.cs create mode 100644 Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleUI.cs.meta (limited to 'Assets/UI_Extension/Scripts/Animation/Tween') diff --git a/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs index f98c47d..e0f2b9a 100644 --- a/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs +++ b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenAnimationInspector.cs @@ -9,66 +9,24 @@ namespace TweenAnimation [CustomEditor(typeof(TweenAnimation), false)] public partial class TweenAnimationInspector : Editor { - - - public override void OnInspectorGUI() + private TweenModuleGUIStyles styles { - TweenAnimation tween = target as TweenAnimation; - - EditorGUILayout.LabelField("Tween Alpha", TweenModuleGUIStyles.Get().moduleHeaderStyle); - // GUILayout.Button("button", "ProfilerBadge"); - //DrawProObjectField(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( - 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) + get { - EditorGUILayout.LabelField(label, - new GUIContent(tObj.name, objIcon), style, options); + return TweenModuleGUIStyles.Get(); } + } - if (GUILayout.Button("Select")) - { - EditorGUIUtility.ShowObjectPicker( - tObj, allowSceneObjects, "", pickerID); + public void Awake() + { + } - } - if (Event.current.commandName == "ObjectSelectorUpdated") - { - if (EditorGUIUtility.GetObjectPickerControlID() == pickerID) - { - tObj = EditorGUIUtility.GetObjectPickerObject() as T; - value.objectReferenceValue = tObj; - } - } + public override void OnInspectorGUI() + { + TweenAnimation tween = target as TweenAnimation; + GUILayout.Label("content", styles.editableLabel); + GUILayout.Label("content", styles.editableLabel); } } diff --git a/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleUI.cs b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleUI.cs new file mode 100644 index 0000000..9819014 --- /dev/null +++ b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleUI.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public static class TweenModuleUI +{ + public static float GUIFloat(GUIContent guiContent, float floatValue, string formatString, params GUILayoutOption[] layoutOptions) + { + + return floatValue; + } + +} diff --git a/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleUI.cs.meta b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleUI.cs.meta new file mode 100644 index 0000000..80bc82f --- /dev/null +++ b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleUI.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df8732181e7474c4eb4dda361b8f837d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/UI_Extension/Scripts/Animation/Tween/TweenAnimation.cs b/Assets/UI_Extension/Scripts/Animation/Tween/TweenAnimation.cs index bd0bae6..93b5b17 100644 --- a/Assets/UI_Extension/Scripts/Animation/Tween/TweenAnimation.cs +++ b/Assets/UI_Extension/Scripts/Animation/Tween/TweenAnimation.cs @@ -9,6 +9,8 @@ namespace TweenAnimation [DisallowMultipleComponent] public class TweenAnimation : MonoBehaviour { + + public List modules; public UnityEvent onPlayEnd; diff --git a/Assets/UI_Extension/Scripts/Animation/Tween/TweenController.cs b/Assets/UI_Extension/Scripts/Animation/Tween/TweenController.cs index c30cf78..e636f23 100644 --- a/Assets/UI_Extension/Scripts/Animation/Tween/TweenController.cs +++ b/Assets/UI_Extension/Scripts/Animation/Tween/TweenController.cs @@ -14,6 +14,8 @@ namespace TweenAnimation public class TweenController : MonoBehaviour { + public AnimationCurve curve; + public List animations; // Use this for initialization diff --git a/Assets/UI_Extension/Scripts/Animation/Tween/TweenModule.cs b/Assets/UI_Extension/Scripts/Animation/Tween/TweenModule.cs index 65cde40..3d4968a 100644 --- a/Assets/UI_Extension/Scripts/Animation/Tween/TweenModule.cs +++ b/Assets/UI_Extension/Scripts/Animation/Tween/TweenModule.cs @@ -8,6 +8,9 @@ namespace TweenAnimation [Serializable] public abstract class TweenModule { + public string description; + + public bool enabled; #if UNITY_EDITOR public abstract string name { get; } -- cgit v1.1-26-g67d0