33 lines
728 B
C#
33 lines
728 B
C#
|
|
#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
|