1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 09:16:02 +08:00

PureQuaternionPlugin now working correctly

This commit is contained in:
Demigiant 2015-10-29 12:28:01 +01:00
parent 8345c34fca
commit 2c22181c73
45 changed files with 10 additions and 3 deletions

View File

@ -6,12 +6,16 @@ using DG.Tweening.CustomPlugins;
public class PureQuaternionPluginTests : BrainBase public class PureQuaternionPluginTests : BrainBase
{ {
public Transform target; public Transform target;
public Transform toTarget;
public Vector3 to; public Vector3 to;
public bool isRelative; public bool isRelative;
public bool useShortcut = true;
public bool useToTarget;
IEnumerator Start() IEnumerator Start()
{ {
yield return new WaitForSeconds(0.5f); yield return new WaitForSeconds(0.5f);
target.DORotateQuaternion(Quaternion.Euler(to), 3).SetLoops(-1, LoopType.Yoyo).SetRelative(isRelative); if (useShortcut) target.DORotateQuaternion(useToTarget ? toTarget.rotation : Quaternion.Euler(to), 3).SetLoops(-1, LoopType.Yoyo).SetRelative(isRelative);
else DOTween.To(PureQuaternionPlugin.Plug(), ()=> target.rotation, x=> target.rotation = x, useToTarget ? toTarget.rotation : Quaternion.Euler(to), 3).SetRelative(isRelative);
} }
} }

View File

@ -60,7 +60,10 @@ namespace DG.Tweening.CustomPlugins
/// <summary>INTERNAL: do not use</summary> /// <summary>INTERNAL: do not use</summary>
public override void SetChangeValue(TweenerCore<Quaternion, Quaternion, NoOptions> t) public override void SetChangeValue(TweenerCore<Quaternion, Quaternion, NoOptions> t)
{ {
t.changeValue = t.endValue * Quaternion.Inverse(t.startValue); t.changeValue.x = t.endValue.x - t.startValue.x;
t.changeValue.y = t.endValue.y - t.startValue.y;
t.changeValue.z = t.endValue.z - t.startValue.z;
t.changeValue.w = t.endValue.w - t.startValue.w;
} }
/// <summary>INTERNAL: do not use</summary> /// <summary>INTERNAL: do not use</summary>

View File

@ -32,7 +32,7 @@ namespace DG.Tweening
public class DOTween public class DOTween
{ {
/// <summary>DOTween's version</summary> /// <summary>DOTween's version</summary>
public static readonly string Version = "1.1.020"; public static readonly string Version = "1.1.030";
/////////////////////////////////////////////// ///////////////////////////////////////////////
// Options //////////////////////////////////// // Options ////////////////////////////////////

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.