【m】
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenAlpha))]
|
||||
public class TweenAlphaEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenAlpha tw = target as TweenAlpha;
|
||||
GUI.changed = false;
|
||||
|
||||
var from = EditorGUILayout.Slider("From", tw.from, 0f, 1f);
|
||||
var to = EditorGUILayout.Slider("To", tw.to, 0f, 1f);
|
||||
|
||||
var ds = tw.autoCleanup;
|
||||
var pn = tw.colorProperty;
|
||||
|
||||
if (tw.GetComponent<MeshRenderer>() != null)
|
||||
{
|
||||
ds = EditorGUILayout.Toggle("Auto-cleanup", tw.autoCleanup);
|
||||
pn = EditorGUILayout.TextField("Color Property", tw.colorProperty);
|
||||
}
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
tw.autoCleanup = ds;
|
||||
tw.colorProperty = pn;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6ca1a2b070be6f04f9dc2b6756d084ff
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenColor))]
|
||||
public class TweenColorEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenColor tw = target as TweenColor;
|
||||
GUI.changed = false;
|
||||
|
||||
Color from = EditorGUILayout.ColorField("From", tw.from);
|
||||
Color to = EditorGUILayout.ColorField("To", tw.to);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7928b5af346eed04ba391047b8b0ddc8
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenFOV))]
|
||||
public class TweenFOVEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenFOV tw = target as TweenFOV;
|
||||
GUI.changed = false;
|
||||
|
||||
float from = EditorGUILayout.Slider("From", tw.from, 1f, 180f);
|
||||
float to = EditorGUILayout.Slider("To", tw.to, 1f, 180f);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 11db62d6da2a5f34590f41ebb958bd94
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,46 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenHeight))]
|
||||
public class TweenHeightEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenHeight tw = target as TweenHeight;
|
||||
GUI.changed = false;
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(tw.fromTarget != null);
|
||||
var from = EditorGUILayout.FloatField("From", tw.from);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
var fc = (RectTransform)EditorGUILayout.ObjectField(tw.fromTarget, typeof(RectTransform), true, GUILayout.Width(110f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(tw.toTarget != null);
|
||||
var to = EditorGUILayout.FloatField("To", tw.to);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
var tc = (RectTransform)EditorGUILayout.ObjectField(tw.toTarget, typeof(RectTransform), true, GUILayout.Width(110f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (from < 0) from = 0;
|
||||
if (to < 0) to = 0;
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
tw.fromTarget = fc;
|
||||
tw.toTarget = tc;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c135e5506eb921409b47fa6543134ec
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,33 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenOrthoSize))]
|
||||
public class TweenOrthoSizeEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenOrthoSize tw = target as TweenOrthoSize;
|
||||
GUI.changed = false;
|
||||
|
||||
float from = EditorGUILayout.FloatField("From", tw.from);
|
||||
float to = EditorGUILayout.FloatField("To", tw.to);
|
||||
|
||||
if (from < 0f) from = 0f;
|
||||
if (to < 0f) to = 0f;
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37cda4ddb333a6d469473d36a439d20e
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenPosition))]
|
||||
public class TweenPositionEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenPosition tw = target as TweenPosition;
|
||||
GUI.changed = false;
|
||||
|
||||
Vector3 from = EditorGUILayout.Vector3Field("From", tw.from);
|
||||
Vector3 to = EditorGUILayout.Vector3Field("To", tw.to);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c3ed7d7dc3fe434d8fbe43ba848c7de
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,32 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenRotation))]
|
||||
public class TweenRotationEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenRotation tw = target as TweenRotation;
|
||||
GUI.changed = false;
|
||||
|
||||
Vector3 from = EditorGUILayout.Vector3Field("From", tw.from);
|
||||
Vector3 to = EditorGUILayout.Vector3Field("To", tw.to);
|
||||
var quat = EditorGUILayout.Toggle("Quaternion", tw.quaternionLerp);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
tw.quaternionLerp = quat;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 37920e4b9f98bd44fa1250a9d995475c
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenScale))]
|
||||
public class TweenScaleEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenScale tw = target as TweenScale;
|
||||
GUI.changed = false;
|
||||
|
||||
Vector3 from = EditorGUILayout.Vector3Field("From", tw.from);
|
||||
Vector3 to = EditorGUILayout.Vector3Field("To", tw.to);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 50b7b0504ae552a42b20841c085dc185
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,9 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenTransform))]
|
||||
public class TweenTransformEditor : UITweenerEditor
|
||||
{
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9ff6713338f44844c82de82685521dd3
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,30 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenVolume))]
|
||||
public class TweenVolumeEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenVolume tw = target as TweenVolume;
|
||||
GUI.changed = false;
|
||||
|
||||
float from = EditorGUILayout.Slider("From", tw.from, 0f, 1f);
|
||||
float to = EditorGUILayout.Slider("To", tw.to, 0f, 1f);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 023e6404a70e48148b315cf9737211af
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
@@ -0,0 +1,46 @@
|
||||
#if UNITY_EDITOR
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(TweenWidth))]
|
||||
public class TweenWidthEditor : UITweenerEditor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 120f;
|
||||
|
||||
TweenWidth tw = target as TweenWidth;
|
||||
GUI.changed = false;
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(tw.fromTarget != null);
|
||||
var from = EditorGUILayout.FloatField("From", tw.from);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
var fc = (RectTransform)EditorGUILayout.ObjectField(tw.fromTarget, typeof(RectTransform), true, GUILayout.Width(110f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUI.BeginDisabledGroup(tw.toTarget != null);
|
||||
var to = EditorGUILayout.FloatField("To", tw.to);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
var tc = (RectTransform)EditorGUILayout.ObjectField(tw.toTarget, typeof(RectTransform), true, GUILayout.Width(110f));
|
||||
EditorGUILayout.EndHorizontal();
|
||||
|
||||
if (from < 0) from = 0;
|
||||
if (to < 0) to = 0;
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
//NGUIEditorTools.RegisterUndo("Tween Change", tw);
|
||||
tw.from = from;
|
||||
tw.to = to;
|
||||
tw.fromTarget = fc;
|
||||
tw.toTarget = tc;
|
||||
//NGUITools.SetDirty(tw);
|
||||
}
|
||||
|
||||
DrawCommonProperties();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d35cd8e39586acb4a842a0c77019d598
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
118
Assets/UI/Scripts/UIFramework/Editor/Tweening/UITweenerEditor.cs
Normal file
118
Assets/UI/Scripts/UIFramework/Editor/Tweening/UITweenerEditor.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
#if UNITY_EDITOR
|
||||
//-------------------------------------------------
|
||||
// NGUI: Next-Gen UI kit
|
||||
// Copyright © 2011-2020 Tasharen Entertainment Inc
|
||||
//-------------------------------------------------
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
|
||||
[CustomEditor(typeof(UITweener), true)]
|
||||
public class UITweenerEditor : Editor
|
||||
{
|
||||
public override void OnInspectorGUI ()
|
||||
{
|
||||
GUILayout.Space(6f);
|
||||
EditorGUIUtility.labelWidth = 110f;
|
||||
base.OnInspectorGUI();
|
||||
DrawCommonProperties();
|
||||
}
|
||||
|
||||
static public bool DrawHeader(string text, string key, bool forceOn, bool minimalistic)
|
||||
{
|
||||
bool state = EditorPrefs.GetBool(key, true);
|
||||
|
||||
if (!minimalistic) GUILayout.Space(3f);
|
||||
if (!forceOn && !state) GUI.backgroundColor = new Color(0.8f, 0.8f, 0.8f);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUI.changed = false;
|
||||
|
||||
if (minimalistic)
|
||||
{
|
||||
if (state) text = "\u25BC" + (char)0x200a + text;
|
||||
else text = "\u25BA" + (char)0x200a + text;
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUI.contentColor = EditorGUIUtility.isProSkin ? new Color(1f, 1f, 1f, 0.7f) : new Color(0f, 0f, 0f, 0.7f);
|
||||
if (!GUILayout.Toggle(true, text, "PreToolbar2", GUILayout.MinWidth(20f))) state = !state;
|
||||
GUI.contentColor = Color.white;
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
else
|
||||
{
|
||||
text = "<b><size=11>" + text + "</size></b>";
|
||||
if (state) text = "\u25BC " + text;
|
||||
else text = "\u25BA " + text;
|
||||
if (!GUILayout.Toggle(true, text, "dragtab", GUILayout.MinWidth(20f))) state = !state;
|
||||
}
|
||||
|
||||
if (GUI.changed) EditorPrefs.SetBool(key, state);
|
||||
|
||||
if (!minimalistic) GUILayout.Space(2f);
|
||||
GUILayout.EndHorizontal();
|
||||
GUI.backgroundColor = Color.white;
|
||||
if (!forceOn && !state) GUILayout.Space(3f);
|
||||
return state;
|
||||
}
|
||||
|
||||
static public void BeginContents()
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal(GUILayout.MinHeight(10f));
|
||||
GUILayout.Space(10f);
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Space(2f);
|
||||
}
|
||||
static public void EndContents()
|
||||
{
|
||||
GUILayout.Space(3f);
|
||||
GUILayout.EndVertical();
|
||||
EditorGUILayout.EndHorizontal();
|
||||
GUILayout.Space(3f);
|
||||
}
|
||||
|
||||
protected void DrawCommonProperties ()
|
||||
{
|
||||
UITweener tw = target as UITweener;
|
||||
|
||||
if (DrawHeader("Tweener", "Tweener", false , true))
|
||||
{
|
||||
BeginContents();
|
||||
EditorGUIUtility.labelWidth = 110f;
|
||||
|
||||
GUI.changed = false;
|
||||
|
||||
UITweener.Style style = (UITweener.Style)EditorGUILayout.EnumPopup("Play Style", tw.style);
|
||||
AnimationCurve curve = EditorGUILayout.CurveField("Animation Curve", tw.animationCurve, GUILayout.Width(170f), GUILayout.Height(62f));
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
float dur = EditorGUILayout.FloatField("Duration", tw.duration, GUILayout.Width(170f));
|
||||
GUILayout.Label("seconds");
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
float del = EditorGUILayout.FloatField("Start Delay", tw.delay, GUILayout.Width(170f));
|
||||
GUILayout.Label("seconds");
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
var deff = (UITweener.DelayAffects)EditorGUILayout.EnumPopup("Delay Affects", tw.delayAffects);
|
||||
|
||||
int tg = EditorGUILayout.IntField("Tween Group", tw.tweenGroup, GUILayout.Width(170f));
|
||||
bool ts = EditorGUILayout.Toggle("Ignore TimeScale", tw.ignoreTimeScale);
|
||||
bool fx = EditorGUILayout.Toggle("Use Fixed Update", tw.useFixedUpdate);
|
||||
|
||||
if (GUI.changed)
|
||||
{
|
||||
tw.animationCurve = curve;
|
||||
tw.style = style;
|
||||
tw.ignoreTimeScale = ts;
|
||||
tw.tweenGroup = tg;
|
||||
tw.duration = dur;
|
||||
tw.delay = del;
|
||||
tw.delayAffects = deff;
|
||||
tw.useFixedUpdate = fx;
|
||||
}
|
||||
EndContents();
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3564c93409a4aaa44a48de1e49be56ba
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
Reference in New Issue
Block a user