示例#1
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenSliderValue Begin(GameObject go, float duration, float value)
    {
        TweenSliderValue comp = UITweener.Begin <TweenSliderValue>(go, duration);

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

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
示例#2
0
    public override void OnInspectorGUI()
    {
        GUILayout.Space(6f);
        NGUIEditorTools.SetLabelWidth(120f);

        TweenSliderValue tw = target as TweenSliderValue;

        GUI.changed = false;

        float from = EditorGUILayout.Slider("From", tw.from, 0f, 1f);
        float to   = EditorGUILayout.Slider("To", tw.to, 0f, 1f);

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

        DrawCommonProperties();
    }