mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2026-02-12 18:18:56 +08:00
DOBlendableLocalRotation fix
This commit is contained in:
parent
40dbd39b0e
commit
d51af7ee07
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -692,11 +692,11 @@ namespace DG.Tweening
|
|||||||
/// <param name="mode">Rotation mode</param>
|
/// <param name="mode">Rotation mode</param>
|
||||||
public static Tweener DOBlendableLocalRotateBy(this Transform target, Vector3 byValue, float duration, RotateMode mode = RotateMode.Fast)
|
public static Tweener DOBlendableLocalRotateBy(this Transform target, Vector3 byValue, float duration, RotateMode mode = RotateMode.Fast)
|
||||||
{
|
{
|
||||||
Quaternion to = target.rotation;
|
Quaternion to = target.localRotation;
|
||||||
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => to, x => {
|
TweenerCore<Quaternion, Vector3, QuaternionOptions> t = DOTween.To(() => to, x => {
|
||||||
Quaternion diff = x * Quaternion.Inverse(to);
|
Quaternion diff = x * Quaternion.Inverse(to);
|
||||||
to = x;
|
to = x;
|
||||||
target.rotation = target.rotation * Quaternion.Inverse(target.rotation) * diff * target.rotation;
|
target.localRotation = target.localRotation * Quaternion.Inverse(target.localRotation) * diff * target.localRotation;
|
||||||
}, byValue, duration)
|
}, byValue, duration)
|
||||||
.Blendable().SetTarget(target);
|
.Blendable().SetTarget(target);
|
||||||
t.plugOptions.rotateMode = mode;
|
t.plugOptions.rotateMode = mode;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user