From d69611d66431e28ea35477c6781a00d57ae04fa3 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 7 Apr 2021 21:13:03 +0800 Subject: =?UTF-8?q?*=E5=9B=A0=E4=B8=BA=E6=B2=A1=E6=9C=89meta=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4missing=EF=BC=8C=E5=88=A0=E9=99=A4UIEffect?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Test/UIEffect/Program/Editor/UIShinyEditor.cs | 102 --------------------- 1 file changed, 102 deletions(-) delete mode 100644 Assets/Test/UIEffect/Program/Editor/UIShinyEditor.cs (limited to 'Assets/Test/UIEffect/Program/Editor/UIShinyEditor.cs') diff --git a/Assets/Test/UIEffect/Program/Editor/UIShinyEditor.cs b/Assets/Test/UIEffect/Program/Editor/UIShinyEditor.cs deleted file mode 100644 index e77432a..0000000 --- a/Assets/Test/UIEffect/Program/Editor/UIShinyEditor.cs +++ /dev/null @@ -1,102 +0,0 @@ -using UnityEditor; -using UnityEditorInternal; -using UnityEngine; -using System.Linq; - -namespace Coffee.UIEffects.Editors -{ - /// - /// UIEffect editor. - /// - [CustomEditor(typeof(UIShiny))] - [CanEditMultipleObjects] - public class UIShinyEditor : Editor - { - SerializedProperty _spEffectFactor; - SerializedProperty _spWidth; - SerializedProperty _spRotation; - SerializedProperty _spSoftness; - SerializedProperty _spBrightness; - SerializedProperty _spGloss; - SerializedProperty _spEffectArea; - SerializedProperty _spPlay; - SerializedProperty _spLoop; - SerializedProperty _spLoopDelay; - SerializedProperty _spDuration; - SerializedProperty _spInitialPlayDelay; - SerializedProperty _spUpdateMode; - - /// - /// This function is called when the object becomes enabled and active. - /// - protected void OnEnable() - { - _spEffectFactor = serializedObject.FindProperty("m_EffectFactor"); - _spEffectArea = serializedObject.FindProperty("m_EffectArea"); - _spWidth = serializedObject.FindProperty("m_Width"); - _spRotation = serializedObject.FindProperty("m_Rotation"); - _spSoftness = serializedObject.FindProperty("m_Softness"); - _spBrightness = serializedObject.FindProperty("m_Brightness"); - _spGloss = serializedObject.FindProperty("m_Gloss"); - var player = serializedObject.FindProperty("m_Player"); - _spPlay = player.FindPropertyRelative("play"); - _spDuration = player.FindPropertyRelative("duration"); - _spInitialPlayDelay = player.FindPropertyRelative("initialPlayDelay"); - _spLoop = player.FindPropertyRelative("loop"); - _spLoopDelay = player.FindPropertyRelative("loopDelay"); - _spUpdateMode = player.FindPropertyRelative("updateMode"); - } - - /// - /// Implement this function to make a custom inspector. - /// - public override void OnInspectorGUI() - { - serializedObject.Update(); - - //================ - // Effect setting. - //================ - EditorGUILayout.PropertyField(_spEffectFactor); - EditorGUILayout.PropertyField(_spWidth); - EditorGUILayout.PropertyField(_spRotation); - EditorGUILayout.PropertyField(_spSoftness); - EditorGUILayout.PropertyField(_spBrightness); - EditorGUILayout.PropertyField(_spGloss); - - //================ - // Advanced option. - //================ - EditorGUILayout.PropertyField(_spEffectArea); - - //================ - // Effect player. - //================ - EditorGUILayout.PropertyField(_spPlay); - EditorGUILayout.PropertyField(_spDuration); - EditorGUILayout.PropertyField(_spInitialPlayDelay); - EditorGUILayout.PropertyField(_spLoop); - EditorGUILayout.PropertyField(_spLoopDelay); - EditorGUILayout.PropertyField(_spUpdateMode); - - // Debug. - using (new EditorGUI.DisabledGroupScope(!Application.isPlaying)) - using (new EditorGUILayout.HorizontalScope(EditorStyles.helpBox)) - { - GUILayout.Label("Debug"); - - if (GUILayout.Button("Play", "ButtonLeft")) - { - (target as UIShiny).Play(); - } - - if (GUILayout.Button("Stop", "ButtonRight")) - { - (target as UIShiny).Stop(); - } - } - - serializedObject.ApplyModifiedProperties(); - } - } -} -- cgit v1.1-26-g67d0