public override void OnInspectorGUI() { GUILayout.Space(6f); NGUIEditorTools.SetLabelWidth(120f); TweenBorder tw = target as TweenBorder; GUI.changed = false; NGUIEditorTools.DrawBorderProperty("From", serializedObject, "from"); NGUIEditorTools.DrawBorderProperty("To", serializedObject, "to"); serializedObject.ApplyModifiedProperties(); if (GUI.changed) { NGUIEditorTools.RegisterUndo("Tween Change", tw); if (preview) { tw.Sample(tw.tweenFactor, false); } NGUITools.SetDirty(tw); } DrawCommonProperties(); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenBorder Begin(GameObject go, float duration, Vector4 border) { TweenBorder comp = UITweener.Begin <TweenBorder>(go, duration); comp.from = comp.value; comp.to = border; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }