public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        NGUIEditorTools.SetLabelWidth(120f);

        TweenIntText tw = target as TweenIntText;

        GUI.changed = false;

        long from = EditorGUILayout.LongField("From", tw.from);
        long to   = EditorGUILayout.LongField("To", tw.to);

        if (GUI.changed)
        {
            NGUIEditorTools.RegisterUndo("Tween Change", tw);
            tw.from = from;
            tw.to   = to;
            if (preview)
            {
                tw.Sample(tw.tweenFactor, false);
            }
            NGUITools.SetDirty(tw);
        }

        DrawCommonProperties();
    }
예제 #2
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenIntText Begin(GameObject go, float duration, long num)
    {
        TweenIntText comp = UITweener.Begin <TweenIntText>(go, duration);

        comp.from = comp.value;
        comp.to   = num;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }