mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-21 01:36:05 +08:00
PureQuaternionPlugin now working correctly
This commit is contained in:
parent
8345c34fca
commit
2c22181c73
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -6,12 +6,16 @@ using DG.Tweening.CustomPlugins;
|
||||
public class PureQuaternionPluginTests : BrainBase
|
||||
{
|
||||
public Transform target;
|
||||
public Transform toTarget;
|
||||
public Vector3 to;
|
||||
public bool isRelative;
|
||||
public bool useShortcut = true;
|
||||
public bool useToTarget;
|
||||
|
||||
IEnumerator Start()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -60,7 +60,10 @@ namespace DG.Tweening.CustomPlugins
|
||||
/// <summary>INTERNAL: do not use</summary>
|
||||
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>
|
||||
|
||||
@ -32,7 +32,7 @@ namespace DG.Tweening
|
||||
public class DOTween
|
||||
{
|
||||
/// <summary>DOTween's version</summary>
|
||||
public static readonly string Version = "1.1.020";
|
||||
public static readonly string Version = "1.1.030";
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Options ////////////////////////////////////
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user