Пример #1
0
    public override void Begin()
    {
        base.Begin();

        if (!is2D)
        {
            UITweenDebugLog.DebugLogWarning("not is2D" + typeof(Image));
            return;
        }

        image = GetComponent <Image>();

        if (image == null)
        {
            UITweenDebugLog.DebugLogWarning("this gameObject not add the component " + typeof(Image));
            return;
        }

        if (image.type != Image.Type.Filled)
        {
            image.type = Image.Type.Filled;
        }
        image.fillMethod = Image.FillMethod.Radial360;
        image.fillAmount = from;
        tween            = image.DOFillAmount(to, duration).SetAutoKill(false);

        SetTween(tween);
    }
Пример #2
0
    public override void Begin()
    {
        base.Begin();

        if (!is2D)
        {
            return;
        }

        image = GetComponent <Image>();
        text  = GetComponent <Text>();

        if (image != null)
        {
            Color col = image.color;
            col.a = from;

            image.color = col;
            tween       = image.DOFade(to, duration).SetAutoKill(false);
        }
        else if (text != null)
        {
            Color col = text.color;
            col.a = from;

            text.color = col;
            tween      = text.DOFade(to, duration).SetAutoKill(false);
        }
        else
        {
            UITweenDebugLog.DebugLogWarning("this gameObject not add the component " + typeof(Image) + "    " + typeof(Text));
        }

        SetTween(tween);
    }
Пример #3
0
    public static T Begin <T>(GameObject go) where T : UITween
    {
        T t = go.GetComponent <T>();

        if (t == null)
        {
            t = go.AddComponent <T>();

            if (t == null)
            {
                UITweenDebugLog.DebugLogWarning("conld't get Component  " + typeof(T));
                return(null);
            }
        }

        t.enabled = true;

        return(t);
    }
Пример #4
0
    public void SetTween(Tween _tween)
    {
        if (_tween == null)
        {
            UITweenDebugLog.DebugLogWarning("Tween is null");
            return;
        }

        _tween.SetEase(ease);

        if ((int)loopType < 3)
        {
            _tween.SetLoops(loopTimes, (LoopType)((int)loopType));
        }

        if (ignoreTimeScale)
        {
            _tween.SetUpdate(UpdateType.Normal, true);
        }

        _tween.OnComplete(OnComplete);
    }
Пример #5
0
    public override void Begin()
    {
        base.Begin();

        if (!is2D)
        {
            return;
        }

        slider = GetComponent <Slider>();

        if (slider == null)
        {
            UITweenDebugLog.DebugLogWarning("this gameObject not add the component " + typeof(Slider));
            return;
        }

        slider.value = from;
        tween        = slider.DOValue(to, duration).SetAutoKill(false);

        SetTween(tween);
    }