1
0
mirror of https://github.com/Cardidi/dotween-upm-fork.git synced 2025-12-20 17:26:03 +08:00

Fixed "toPath" orientation not working correctly with local paths

This commit is contained in:
Daniele Giardini 2015-04-29 01:10:38 +02:00
parent 520de672f3
commit d497fa9a6d
15 changed files with 6 additions and 3 deletions

View File

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

View File

@ -53,6 +53,9 @@ namespace DG.Tweening.Plugins
// then sets the final path version
public override void SetChangeValue(TweenerCore<Vector3, Path, PathOptions> t)
{
Transform trans = (Transform)t.target;
if (t.plugOptions.orientType == OrientType.ToPath && t.plugOptions.useLocalPosition) t.plugOptions.parent = trans.parent;
if (t.endValue.isFinalized) {
t.changeValue = t.endValue;
return;
@ -84,9 +87,7 @@ namespace DG.Tweening.Plugins
// Finalize path
path.FinalizePath(t.plugOptions.isClosedPath, t.plugOptions.lockPositionAxis, currVal);
Transform trans = (Transform)t.target;
t.plugOptions.startupZRot = trans.eulerAngles.z;
if (t.plugOptions.orientType == OrientType.ToPath && t.plugOptions.useLocalPosition) t.plugOptions.parent = trans.parent;
// Set changeValue as a reference to endValue
t.changeValue = t.endValue;

View File

@ -676,6 +676,7 @@ namespace DG.Tweening
.SetTarget(target);
t.plugOptions.mode = pathMode;
t.plugOptions.useLocalPosition = true;
return t;
}
// Used by path editor when creating the actual tween, so it can pass a pre-compiled path
@ -697,6 +698,7 @@ namespace DG.Tweening
.SetTarget(target);
t.plugOptions.mode = pathMode;
t.plugOptions.useLocalPosition = true;
return t;
}

Binary file not shown.