From 117938ecaece43c584ee74723a36d8dc2f2a4ae1 Mon Sep 17 00:00:00 2001
From: chai <chaifix@163.com>
Date: Wed, 26 May 2021 19:27:38 +0800
Subject: +Tween Animation

---
 .../Animation/Tween/Editor/TweenModuleGUIStyles.cs | 312 +++++++++++++++++++++
 1 file changed, 312 insertions(+)
 create mode 100644 Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleGUIStyles.cs

(limited to 'Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleGUIStyles.cs')

diff --git a/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleGUIStyles.cs b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleGUIStyles.cs
new file mode 100644
index 0000000..ad9d09a
--- /dev/null
+++ b/Assets/UI_Extension/Scripts/Animation/Tween/Editor/TweenModuleGUIStyles.cs
@@ -0,0 +1,312 @@
+using System;
+using System.Reflection;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEditor;
+
+namespace TweenAnimation
+{
+    internal class TweenModuleGUIStyles
+    {
+        private delegate bool GetBoldDefaultFontFunc();
+        private static GetBoldDefaultFontFunc GetBoldDefaultFont;
+
+        static TweenModuleGUIStyles()
+        {
+            Type editorGUIUtility = typeof(EditorGUIUtility);
+
+            GetBoldDefaultFont = (GetBoldDefaultFontFunc) GetMethod(typeof(GetBoldDefaultFontFunc), typeof(EditorGUIUtility), "GetBoldDefaultFont", BindingFlags.Static | BindingFlags.NonPublic);
+        }
+
+        private static Delegate GetMethod(Type del, Type type, string name, BindingFlags flag)
+        {
+            var method = type.GetMethod(name, flag);
+            Delegate deleg = Delegate.CreateDelegate(del, method);
+            return deleg;
+        }
+
+        public GUIStyle label
+        {
+            get
+            {
+                return GetBoldDefaultFont() ? this.m_LabelBold : this.m_Label;
+            }
+        }
+
+        public GUIStyle editableLabel
+        {
+            get
+            {
+                return GetBoldDefaultFont() ? this.m_EditableLabelBold : this.m_EditableLabel;
+            }
+        }
+
+        public GUIStyle objectField
+        {
+            get
+            {
+                return GetBoldDefaultFont() ? this.m_ObjectFieldBold : this.m_ObjectField;
+            }
+        }
+
+        public GUIStyle numberField
+        {
+            get
+            {
+                return GetBoldDefaultFont() ? this.m_NumberFieldBold : this.m_NumberField;
+            }
+        }
+
+        public GUIStyle moduleHeaderStyle
+        {
+            get
+            {
+                return GetBoldDefaultFont() ? this.m_ModuleHeaderStyleBold : this.m_ModuleHeaderStyle;
+            }
+        }
+
+        public GUIStyle popup
+        {
+            get
+            {
+                return GetBoldDefaultFont() ? this.m_PopupStyleBold : this.m_PopupStyle;
+            }
+        }
+
+        public GUIStyle emitterHeaderStyle
+        {
+            get
+            {
+                return this.m_EmitterHeaderStyle;
+            }
+        }
+
+        public GUIStyle effectBgStyle
+        {
+            get
+            {
+                return this.m_EffectBgStyle;
+            }
+        }
+
+        public GUIStyle moduleBgStyle
+        {
+            get
+            {
+                return this.m_ModuleBgStyle;
+            }
+        }
+
+        public GUIStyle plus
+        {
+            get
+            {
+                return this.m_Plus;
+            }
+        }
+
+        public GUIStyle minus
+        {
+            get
+            {
+                return this.m_Minus;
+            }
+        }
+
+        public GUIStyle checkmark
+        {
+            get
+            {
+                return this.m_Checkmark;
+            }
+        }
+
+        public GUIStyle checkmarkMixed
+        {
+            get
+            {
+                return this.m_CheckmarkMixed;
+            }
+        }
+
+        public GUIStyle minMaxCurveStateDropDown
+        {
+            get
+            {
+                return this.m_MinMaxCurveStateDropDown;
+            }
+        }
+
+        public GUIStyle toggle
+        {
+            get
+            {
+                return this.m_Toggle;
+            }
+        }
+
+        public GUIStyle toggleMixed
+        {
+            get
+            {
+                return this.m_ToggleMixed;
+            }
+        }
+
+        public GUIStyle selectionMarker
+        {
+            get
+            {
+                return this.m_SelectionMarker;
+            }
+        }
+
+        public GUIStyle toolbarButtonLeftAlignText
+        {
+            get
+            {
+                return this.m_ToolbarButtonLeftAlignText;
+            }
+        }
+
+        public GUIStyle modulePadding
+        {
+            get
+            {
+                return this.m_ModulePadding;
+            }
+        }
+
+        public GUIStyle customDataWindow
+        {
+            get
+            {
+                return this.m_CustomDataWindow;
+            }
+        }
+
+        public Texture2D warningIcon
+        {
+            get
+            {
+                return this.m_WarningIcon;
+            }
+        }
+
+        private GUIStyle m_Label;
+
+        private GUIStyle m_LabelBold;
+
+        private GUIStyle m_EditableLabel;
+
+        private GUIStyle m_EditableLabelBold;
+
+        private GUIStyle m_ObjectField;
+
+        private GUIStyle m_ObjectFieldBold;
+
+        private GUIStyle m_NumberField;
+
+        private GUIStyle m_NumberFieldBold;
+
+        private GUIStyle m_ModuleHeaderStyle;
+
+        private GUIStyle m_ModuleHeaderStyleBold;
+
+        private GUIStyle m_PopupStyle;
+
+        private GUIStyle m_PopupStyleBold;
+
+        private GUIStyle m_EmitterHeaderStyle;
+
+        private GUIStyle m_EffectBgStyle;
+
+        private GUIStyle m_ModuleBgStyle;
+
+        private GUIStyle m_Plus;
+
+        private GUIStyle m_Minus;
+
+        private GUIStyle m_Checkmark;
+
+        private GUIStyle m_CheckmarkMixed;
+
+        private GUIStyle m_MinMaxCurveStateDropDown;
+
+        private GUIStyle m_Toggle;
+
+        private GUIStyle m_ToggleMixed;
+
+        private GUIStyle m_SelectionMarker;
+
+        private GUIStyle m_ToolbarButtonLeftAlignText;
+
+        private GUIStyle m_ModulePadding;
+
+        private GUIStyle m_CustomDataWindow;
+
+        private Texture2D m_WarningIcon;
+
+        private static TweenModuleGUIStyles s_TweenModuleGUIStyles;
+
+        public static TweenModuleGUIStyles Get()
+        {
+            bool flag = s_TweenModuleGUIStyles == null;
+            if (flag)
+            {
+                s_TweenModuleGUIStyles = new TweenModuleGUIStyles();
+            }
+            return s_TweenModuleGUIStyles;
+        }
+
+        private TweenModuleGUIStyles()
+        {
+            InitStyle(out this.m_Label, out this.m_LabelBold, "ShurikenLabel");
+            InitStyle(out this.m_EditableLabel, out this.m_EditableLabelBold, "ShurikenEditableLabel");
+            InitStyle(out this.m_ObjectField, out this.m_ObjectFieldBold, "ShurikenObjectField");
+            InitStyle(out this.m_NumberField, out this.m_NumberFieldBold, "ShurikenValue");
+            InitStyle(out this.m_ModuleHeaderStyle, out this.m_ModuleHeaderStyleBold, "ShurikenModuleTitle");
+            InitStyle(out this.m_PopupStyle, out this.m_PopupStyleBold, "ShurikenPopUp");
+            InitStyle(out this.m_EmitterHeaderStyle, "ShurikenEmitterTitle");
+            InitStyle(out this.m_EmitterHeaderStyle, "ShurikenEmitterTitle");
+            InitStyle(out this.m_EffectBgStyle, "ShurikenEffectBg");
+            InitStyle(out this.m_ModuleBgStyle, "ShurikenModuleBg");
+            InitStyle(out this.m_Plus, "OL Plus");
+            InitStyle(out this.m_Minus, "OL Minus");
+            InitStyle(out this.m_Checkmark, "ShurikenCheckMark");
+            InitStyle(out this.m_CheckmarkMixed, "ShurikenCheckMarkMixed");
+            InitStyle(out this.m_MinMaxCurveStateDropDown, "ShurikenDropdown");
+            InitStyle(out this.m_Toggle, "ShurikenToggle");
+            InitStyle(out this.m_ToggleMixed, "ShurikenToggleMixed");
+            InitStyle(out this.m_SelectionMarker, "IN ThumbnailShadow");
+            InitStyle(out this.m_ToolbarButtonLeftAlignText, "ToolbarButton");
+            this.m_CustomDataWindow = new GUIStyle(GUI.skin.window);
+            this.m_CustomDataWindow.font = EditorStyles.miniFont;
+            this.m_EmitterHeaderStyle.clipping = TextClipping.Clip;
+            this.m_EmitterHeaderStyle.padding.right = 45;
+            //this.m_WarningIcon = EditorGUIUtility.LoadIcon("console.infoicon.sml");
+            this.m_ToolbarButtonLeftAlignText = new GUIStyle(this.m_ToolbarButtonLeftAlignText);
+            this.m_ToolbarButtonLeftAlignText.alignment = TextAnchor.MiddleLeft;
+            this.m_ModulePadding = new GUIStyle();
+            this.m_ModulePadding.padding = new RectOffset(3, 3, 4, 2);
+        }
+
+        private static void InitStyle(out GUIStyle normal, string name)
+        {
+            normal = FindStyle(name);
+        }
+
+        private static void InitStyle(out GUIStyle normal, out GUIStyle bold, string name)
+        {
+            InitStyle(out normal, name);
+            bold = new GUIStyle(normal);
+            bold.font = EditorStyles.miniBoldFont;
+        }
+
+        private static GUIStyle FindStyle(string styleName)
+        {
+            return styleName;
+        }
+    }
+}
\ No newline at end of file
-- 
cgit v1.1-26-g67d0