public static TweenHeight Begin(UIWidget widget, float duration, int height) { TweenHeight tweenHeight = UITweener.Begin <TweenHeight>(widget.gameObject, duration); tweenHeight.from = widget.height; tweenHeight.to = height; if (duration <= 0f) { tweenHeight.Sample(1f, true); tweenHeight.enabled = false; } return(tweenHeight); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenHeight Begin(UIWidget widget, float duration, int height) { TweenHeight comp = UITweener.Begin <TweenHeight>(widget.gameObject, duration); comp.from = widget.height; comp.to = height; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
/// <summary> /// Start the tweening operation. /// </summary> static public TweenHeight Begin(RectTransform tf, float duration, int height) { TweenHeight comp = UITweener.Begin <TweenHeight>(tf.gameObject, duration); comp.from = tf.sizeDelta.y; comp.to = height; if (duration <= 0f) { comp.Sample(1f, true); comp.enabled = false; } return(comp); }
public static TweenHeight Begin(UIWidget widget, float duration, int height) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown TweenHeight tweenHeight = UITweener.Begin <TweenHeight>(widget.get_gameObject(), duration, true); tweenHeight.from = widget.height; tweenHeight.to = height; if (duration <= 0f) { tweenHeight.Sample(1f, true); tweenHeight.set_enabled(false); } return(tweenHeight); }
public override void OnInspectorGUI() { GUILayout.Space(6f); NGUIEditorTools.SetLabelWidth(120f); TweenHeight tw = target as TweenHeight; GUI.changed = false; int from = EditorGUILayout.IntField("From", tw.from); int to = EditorGUILayout.IntField("To", tw.to); bool table = EditorGUILayout.Toggle("Update Table", tw.updateTable); 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.updateTable = table; if (preview) { tw.Sample(tw.tweenFactor, false); } NGUITools.SetDirty(tw); } DrawCommonProperties(); }