public static CCUIBezier Create(float duartion, BezierConfig config) { return(new CCUIBezier { Config = config, _duration = duartion, }); }
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; }
public static CCUIBezier Create(float duartion, BezierConfig config) { return new CCUIBezier { Config = config, _duration = duartion, }; }
public void setParamas(BezierConfig config, float duration) { _config = config; _duration = duration; }