Пример #1
0
 public static CCUIBezier Create(float duartion, BezierConfig config)
 {
     return(new CCUIBezier {
         Config = config,
         _duration = duartion,
     });
 }
Пример #2
0
    void Update()
    {
        if (_needToRun == false)
        {
            return;
        }

        Vector3      curPos;
        BezierConfig config = _config;

        if (_curTime > _duration)
        {
            _needToRun = false;

            curPos = config.GetPointAtTime(_duration);
            gameObject.transform.localPosition = curPos;

            if (MOVE_END != null)
            {
                MOVE_END();
            }

            return;
        }

        curPos = config.GetPointAtTime(_curTime / _duration);
        gameObject.transform.localPosition = curPos;

        _curTime += Time.deltaTime;
    }
Пример #3
0
 public static CCUIBezier Create(float duartion, BezierConfig config)
 {
     return new CCUIBezier {
         Config      = config,
         _duration   = duartion,
     };
 }
Пример #4
0
 public void setParamas(BezierConfig config, float duration)
 {
     _config   = config;
     _duration = duration;
 }