public override void OnInspectorGUI() { TweenAnchoredPosition tween = target as TweenAnchoredPosition; tween.from = EditorGUILayout.Vector2Field("From", tween.from); tween.to = EditorGUILayout.Vector2Field("To", tween.to); base.OnInspectorGUI(); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenAnchoredPosition Begin(GameObject go, float duration, Vector3 pos) { TweenAnchoredPosition comp = UITweener.Begin <TweenAnchoredPosition>(go, duration); comp.from = comp.value; comp.to = pos; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }