コード例 #1
0
ファイル: TweenSlider.cs プロジェクト: whztt07/mobahero_src
    public static TweenSlider Begin(GameObject go, float duration, float fill)
    {
        TweenSlider tweenSlider = UITweener.Begin <TweenSlider>(go, duration);

        tweenSlider.from = tweenSlider.value;
        tweenSlider.to   = fill;
        if (duration <= 0f)
        {
            tweenSlider.Sample(1f, true);
            tweenSlider.enabled = false;
        }
        return(tweenSlider);
    }
コード例 #2
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

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

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

        if (duration <= 0.0f)
        {
            comp.Sample(1.0f, true);
            comp.enabled = false;
        }
        return(comp);
    }
コード例 #3
0
    public static TweenSlider Begin(Slider slider, float duration, float delay, float from, float to)
    {
        TweenSlider comp = UITweener.Begin <TweenSlider>(slider.gameObject, duration);

        comp.from  = from;
        comp.to    = to;
        comp.delay = delay;

        if (duration <= 0)
        {
            comp.Sample(1, true);
            comp.enabled = false;
        }
        return(comp);
    }
コード例 #4
0
    static public TweenSlider Begin(UISlider slider, float duration, float value)
    {
        TweenSlider comp = UITweener.Begin <TweenSlider>(slider.gameObject, duration);

        if (comp != null)
        {
            comp.from   = comp.Value;
            comp.to     = value;
            comp.slider = slider;
            if (duration <= 0.0f)
            {
                comp.Sample(1.0f, true);
                comp.enabled = false;
            }
        }
        return(comp);
    }
コード例 #5
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public TweenSlider Begin(GameObject go, float duration, float number)
    {
                #if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            return(null);
        }
                #endif
        TweenSlider comp = UITweener.Begin <TweenSlider>(go, duration);
        comp.from = comp.number;
        comp.to   = number;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
コード例 #6
0
    static public TweenSlider Begin(UISlider slider, float value, float speed, float maxDuration)
    {
        TweenSlider comp = UITweener.Begin <TweenSlider>(slider.gameObject, 1f);

        if (comp != null)
        {
            comp.from   = comp.Value;
            comp.to     = value;
            comp.slider = slider;

            comp.duration = Mathf.Max(0.1f, Mathf.Min(Mathf.Abs(comp.to = comp.from) / speed, maxDuration));

            if (speed < 0.0f)
            {
                comp.Sample(1.0f, true);
                comp.enabled = false;
            }
        }
        return(comp);
    }