Beispiel #1
0
        /// <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);
                };
            }
        }