-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using UnityEditor; | ||
|
||
namespace UnityEngine.UI | ||
{ | ||
[CustomEditor(typeof(TweenCGAlpha))] | ||
[CanEditMultipleObjects] | ||
public class TweenCGAlphaEditor : TweenMainEditor | ||
{ | ||
private SerializedProperty | ||
_fromProperty, | ||
_fromOffsetProperty, | ||
_toProperty, | ||
_toOffsetProperty; | ||
|
||
protected override void OnEnable() | ||
{ | ||
base.OnEnable(); | ||
_fromProperty = serializedObject.FindProperty("from"); | ||
_fromOffsetProperty = serializedObject.FindProperty("fromOffset"); | ||
_toProperty = serializedObject.FindProperty("to"); | ||
_toOffsetProperty = serializedObject.FindProperty("toOffset"); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
EditorGUILayout.Slider(_fromProperty, 0f, 1f); | ||
if (GUILayout.Button("\u25C0", GUILayout.Width(24f))) | ||
{ | ||
foreach (var i in targets) | ||
{ | ||
var self = (TweenCGAlpha) i; | ||
self.FromCurrentValue(); | ||
} | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
EditorGUILayout.PropertyField(_fromOffsetProperty); | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
EditorGUILayout.Slider(_toProperty, 0f, 1f); | ||
if (GUILayout.Button("\u25C0", GUILayout.Width(24f))) | ||
{ | ||
foreach (var i in targets) | ||
{ | ||
var self = (TweenCGAlpha) i; | ||
self.ToCurrentValue(); | ||
} | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
EditorGUILayout.PropertyField(_toOffsetProperty); | ||
serializedObject.ApplyModifiedProperties(); | ||
|
||
EditorGUILayout.Separator(); | ||
BaseTweenerProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using UnityEditor; | ||
|
||
namespace UnityEngine.UI | ||
{ | ||
[CustomEditor(typeof(TweenColor))] | ||
[CanEditMultipleObjects] | ||
public class TweenColorEditor : TweenMainEditor | ||
{ | ||
private SerializedProperty | ||
_fromProperty, | ||
_toProperty; | ||
|
||
protected override void OnEnable() | ||
{ | ||
base.OnEnable(); | ||
_fromProperty = serializedObject.FindProperty("from"); | ||
_toProperty = serializedObject.FindProperty("to"); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
EditorGUILayout.PropertyField(_fromProperty); | ||
if (GUILayout.Button("\u25C0", GUILayout.Width(24f))) | ||
{ | ||
foreach (var i in targets) | ||
{ | ||
var self = (TweenColor) i; | ||
self.FromCurrentValue(); | ||
} | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
EditorGUILayout.PropertyField(_toProperty); | ||
if (GUILayout.Button("\u25C0", GUILayout.Width(24f))) | ||
{ | ||
foreach (var i in targets) | ||
{ | ||
var self = (TweenColor) i; | ||
self.ToCurrentValue(); | ||
} | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
serializedObject.ApplyModifiedProperties(); | ||
|
||
EditorGUILayout.Separator(); | ||
BaseTweenerProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
using UnityEditor; | ||
|
||
namespace UnityEngine.UI | ||
{ | ||
[CustomEditor(typeof(TweenMain), true)] | ||
[CanEditMultipleObjects] | ||
public class TweenMainEditor : Editor | ||
{ | ||
protected SerializedProperty | ||
style, | ||
method, | ||
functionCurve, | ||
delay, | ||
duration, | ||
ignoreTimeScale, | ||
onFinished; | ||
|
||
private bool tweenerFoldOut = true; | ||
|
||
protected virtual void OnEnable() | ||
{ | ||
style = serializedObject.FindProperty("style"); | ||
method = serializedObject.FindProperty("method"); | ||
functionCurve = serializedObject.FindProperty("functionCurve"); | ||
ignoreTimeScale = serializedObject.FindProperty("ignoreTimeScale"); | ||
delay = serializedObject.FindProperty("delay"); | ||
duration = serializedObject.FindProperty("duration"); | ||
onFinished = serializedObject.FindProperty("OnFinished"); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
base.OnInspectorGUI(); | ||
BaseTweenerProperties(); | ||
} | ||
|
||
protected void BaseTweenerProperties() | ||
{ | ||
serializedObject.Update(); | ||
|
||
tweenerFoldOut = EditorGUILayout.Foldout(tweenerFoldOut, "TweenSettings:"); | ||
if (tweenerFoldOut) | ||
{ | ||
BeginContents(); | ||
EditorGUILayout.PropertyField(style, new GUIContent("Tween Style")); | ||
EditorGUILayout.PropertyField(method); | ||
EditorGUILayout.PropertyField(functionCurve, new GUIContent("Curve"), GUILayout.Height(52f)); | ||
EditorGUILayout.PropertyField(ignoreTimeScale, new GUIContent("Ignore TimeScale")); | ||
EditorGUILayout.PropertyField(delay); | ||
EditorGUILayout.PropertyField(duration); | ||
EndContents(); | ||
} | ||
|
||
EditorGUILayout.PropertyField(onFinished, new GUIContent("OnFinished")); | ||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
|
||
protected void BeginContents() | ||
{ | ||
EditorGUILayout.BeginHorizontal(GUILayout.MinHeight(10f)); | ||
GUILayout.Space(10f); | ||
GUILayout.BeginVertical(); | ||
GUILayout.Space(2f); | ||
} | ||
|
||
protected void EndContents() | ||
{ | ||
GUILayout.Space(3f); | ||
GUILayout.EndVertical(); | ||
EditorGUILayout.EndHorizontal(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using UnityEditor; | ||
|
||
namespace UnityEngine.UI | ||
{ | ||
[CustomEditor(typeof(TweenPos))] | ||
[CanEditMultipleObjects] | ||
public class TweenPosEditor : TweenMainEditor | ||
{ | ||
private SerializedProperty | ||
_fromProperty, | ||
_fromOffsetProperty, | ||
_toProperty, | ||
_toOffsetProperty, | ||
_cSpaceProperty; | ||
|
||
protected override void OnEnable() | ||
{ | ||
base.OnEnable(); | ||
_fromProperty = serializedObject.FindProperty("from"); | ||
_fromOffsetProperty = serializedObject.FindProperty("fromOffset"); | ||
_toProperty = serializedObject.FindProperty("to"); | ||
_toOffsetProperty = serializedObject.FindProperty("toOffset"); | ||
_cSpaceProperty = serializedObject.FindProperty("CSpace"); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
EditorGUILayout.PropertyField(_fromProperty); | ||
if (GUILayout.Button("\u25C0", GUILayout.Width(24f))) | ||
{ | ||
foreach (var i in targets) | ||
{ | ||
var self = (TweenPos) i; | ||
self.FromCurrentValue(); | ||
} | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
EditorGUILayout.PropertyField(_fromOffsetProperty, new GUIContent("Offset")); | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
EditorGUILayout.PropertyField(_toProperty); | ||
if (GUILayout.Button("\u25C0", GUILayout.Width(24f))) | ||
{ | ||
foreach (var i in targets) | ||
{ | ||
var self = (TweenPos) i; | ||
self.ToCurrentValue(); | ||
} | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
EditorGUILayout.PropertyField(_toOffsetProperty, new GUIContent("Offset")); | ||
EditorGUILayout.PropertyField(_cSpaceProperty, new GUIContent("Coordinate Space")); | ||
serializedObject.ApplyModifiedProperties(); | ||
|
||
EditorGUILayout.Separator(); | ||
BaseTweenerProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
using UnityEditor; | ||
|
||
namespace UnityEngine.UI | ||
{ | ||
[CustomEditor(typeof(TweenRot))] | ||
[CanEditMultipleObjects] | ||
public class TweenRotEditor : TweenMainEditor | ||
{ | ||
private SerializedProperty | ||
_fromProperty, | ||
_fromOffetProperty, | ||
_toProperty, | ||
_toOffetProperty; | ||
|
||
protected override void OnEnable() | ||
{ | ||
base.OnEnable(); | ||
_fromProperty = serializedObject.FindProperty("from"); | ||
_fromOffetProperty = serializedObject.FindProperty("fromOffset"); | ||
_toProperty = serializedObject.FindProperty("to"); | ||
_toOffetProperty = serializedObject.FindProperty("toOffset"); | ||
} | ||
|
||
public override void OnInspectorGUI() | ||
{ | ||
serializedObject.Update(); | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
EditorGUILayout.PropertyField(_fromProperty); | ||
if (GUILayout.Button("\u25C0", GUILayout.Width(24f))) | ||
{ | ||
foreach (var i in targets) | ||
{ | ||
var self = (TweenRot) i; | ||
self.FromCurrentValue(); | ||
} | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
EditorGUILayout.PropertyField(_fromOffetProperty); | ||
|
||
EditorGUILayout.BeginHorizontal(); | ||
EditorGUILayout.PropertyField(_toProperty); | ||
if (GUILayout.Button("\u25C0", GUILayout.Width(24f))) | ||
{ | ||
foreach (var i in targets) | ||
{ | ||
var self = (TweenRot) i; | ||
self.ToCurrentValue(); | ||
} | ||
} | ||
EditorGUILayout.EndHorizontal(); | ||
EditorGUILayout.PropertyField(_toOffetProperty); | ||
serializedObject.ApplyModifiedProperties(); | ||
|
||
EditorGUILayout.Separator(); | ||
BaseTweenerProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.