Beispiel #1
0
        internal static QuaternionTween GetQuaternionTween(Quaternion from, Quaternion to, float t)
        {
            QuaternionTween tween;

            if (TryGetTween(quaternionTweens, out tween))
            {
                tween.Init(from, to, t);
            }
            else
            {
                tween = new QuaternionTween(from, to, t, GenerateId());
            }
            _activeTweens.Add(tween);
            return(tween);
        }
Beispiel #2
0
        public BaseTween RotateTween(Transform t, Quaternion to, float time)
        {
            QuaternionTween tween = TweenPool.GetQuaternionTween(t.rotation, to, time);

            tween.SetOnUpdateQuaternion(delegate(Quaternion v)
            {
                if (t != null)
                {
                    t.rotation = v;
                }
                else
                {
                    CancelTween(tween);
                }
            });

            return(ProcessTween(tween));
        }