public void SetCurve(Vector3 end, float time) { if (m_object != null) { TweenCurve cur = TweenCurve.Get(m_object); cur.duration = time * 0.001f; cur.from = GetPos(); cur.front = new Vector3(0, 4, 0); cur.back = new Vector3(0, 4, 0); cur.to = end; cur.method = UITweener.Method.EaseIn; cur.Reset(); cur.Play(true); //TweenFloat rota = TweenFloat.Get(m_object); //rota.from = 0; //rota.to = 2000; //rota.duration = time * 0.001f; //rota.Reset(); //rota.Play(true); //rota.FloatUpdateEvent = (val) => { // SetDirection(val * Vector3.one); //}; } }
/// <summary> /// 设置抛物线(贝塞尔曲线) /// </summary> public void SetCurve(Vector3 end, float time, float hight) { if (m_object != null) { TweenCurve cur = TweenCurve.Get(m_object); cur.duration = time * 0.001f; cur.from = GetPos(); cur.front = new Vector3(0, hight, 0); cur.back = new Vector3(0, hight, 0); cur.to = end; cur.method = UITweener.Method.Linear; cur.Reset(); cur.Play(true); TweenFloat rota = TweenFloat.Get(m_object); rota.duration = time * 0.001f; rota.from = 0; rota.to = -360; rota.method = UITweener.Method.EaseOut; rota.Reset(); rota.Play(true); rota.FloatUpdateEvent = (val) => { SetDirection(val * Vector3.one); }; } }