Пример #1
0
    /// <summary>
    /// 寮€濮嬭ˉ闂存搷浣浱
    /// </summary>

    static public CustomTweenVolume Begin(GameObject go, float duration, float targetVolume)
    {
        CustomTweenVolume comp = CustomUITweener.Begin <CustomTweenVolume>(go, duration);

        comp.from = comp.value;
        comp.to   = targetVolume;
        return(comp);
    }
Пример #2
0
    /// <summary>
    /// 开始补间操作
    /// </summary>

    static public CustomTweenAlpha Begin(GameObject go, float duration, float alpha)
    {
        CustomTweenAlpha comp = CustomUITweener.Begin <CustomTweenAlpha>(go, duration);

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

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
    /// <summary>
    /// 开始补间操作
    /// </summary>

    static public CustomTweenRotation Begin(GameObject go, float duration, Quaternion rot)
    {
        CustomTweenRotation comp = CustomUITweener.Begin <CustomTweenRotation>(go, duration);

        comp.from = comp.value.eulerAngles;
        comp.to   = rot.eulerAngles;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
Пример #4
0
    /// <summary>
    /// 开始补间操作
    /// </summary>
    static public CustomTweenScale Begin(GameObject go, float duration, Vector3 scale)
    {
        CustomTweenScale comp = CustomUITweener.Begin <CustomTweenScale>(go, duration);

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

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public CustomTweenTransform Begin(GameObject go, float duration, Transform from, Transform to)
    {
        CustomTweenTransform comp = CustomUITweener.Begin <CustomTweenTransform>(go, duration);

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

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
Пример #6
0
    /// <summary>
    /// 开始补间操作
    /// </summary>

    static public CustomTweenPosition Begin(GameObject go, float duration, Vector3 pos)
    {
        CustomTweenPosition comp = CustomUITweener.Begin <CustomTweenPosition>(go, duration);

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

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
Пример #7
0
    /// <summary>
    /// Start the tweening operation.
    /// </summary>

    static public CustomTweenWidth Begin(RectTransform rectTransform, float duration, int width)
    {
        CustomTweenWidth comp = CustomUITweener.Begin <CustomTweenWidth>(rectTransform.gameObject, duration);

        comp.from = (int)rectTransform.sizeDelta.x;
        comp.to   = width;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
    /// <summary>
    /// 开始补间操作
    /// </summary>
    static public CustomTweenHeight Begin(RectTransform rectTransform, float duration, int height)
    {
        CustomTweenHeight comp = CustomUITweener.Begin <CustomTweenHeight>(rectTransform.gameObject, duration);

        comp.from = (int)rectTransform.sizeDelta.y;
        comp.to   = height;

        if (duration <= 0f)
        {
            comp.Sample(1f, true);
            comp.enabled = false;
        }
        return(comp);
    }
Пример #9
0
    public static CustomTweenText Begin(Text label, float duration, float delay, float from, float to)
    {
        CustomTweenText comp = CustomUITweener.Begin <CustomTweenText>(label.gameObject, duration);

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

        if (duration <= 0)
        {
            comp.Sample(1, true);
            comp.enabled = false;
        }
        return(comp);
    }
Пример #10
0
    public static CustomTweenSlider Begin(Slider slider, float duration, float delay, float from, float to)
    {
        CustomTweenSlider comp = CustomUITweener.Begin <CustomTweenSlider>(slider.gameObject, duration);

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

        if (duration <= 0)
        {
            comp.Sample(1, true);
            comp.enabled = false;
        }
        return(comp);
    }
Пример #11
0
    /// <summary>
    /// 开始补间
    /// </summary>

    static public CustomTweenColor Begin(GameObject go, float duration, Color color)
    {
#if UNITY_EDITOR
        if (!Application.isPlaying)
        {
            return(null);
        }
#endif
        CustomTweenColor comp = CustomUITweener.Begin <CustomTweenColor>(go, duration);
        comp.from = comp.value;
        comp.to   = color;

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