Exemple #1
0
    public static void valueTo(GameObject _obj, long _start, long _end, float _time, bool _isFormat = true, bool _hasPlusImg = false)
    {
        if (_start - _end == 0)
        {
            return;
        }
        TweenTxt tween = _obj.GetComponent <TweenTxt>();

        if (!tween)
        {
            tween = _obj.AddComponent <TweenTxt>();
        }

        /*
         * if (tween.isStart)
         * {
         *  if(_end > tween.endValue)
         *  return;
         * }*/
        tween.endValue       = _end;
        tween.speed          = (_end - _start) / _time;
        tween.executionValue = _start;
        tween.isStart        = true;
        tween.isStrFormat    = _isFormat;
        tween.hasPlusImg     = _hasPlusImg;
    }
Exemple #2
0
    public static void stop(GameObject _obj)
    {
        TweenTxt tween = _obj.GetComponent <TweenTxt>();

        if (tween)
        {
            tween.isStart = false;
            tween.speed   = 0;
        }
    }