mirror of
https://github.com/Cardidi/dotween-upm-fork.git
synced 2025-12-20 09:16:02 +08:00
[bugfix] Fixed SetLookAt and DOPath causing the target to end at the wrong position
This commit is contained in:
parent
e9892b7704
commit
3aae3e29e7
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.
16
UnityTests.Unity5/Assets/_Tests/Bugs/PathEndOffset.cs
Normal file
16
UnityTests.Unity5/Assets/_Tests/Bugs/PathEndOffset.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using DG.Tweening;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class PathEndOffset : MonoBehaviour
|
||||||
|
{
|
||||||
|
public Transform target, toTarget, lookAt;
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
target.DOPath(new Vector3[]{ toTarget.position }, 5, PathType.CatmullRom, PathMode.Full3D)
|
||||||
|
.SetLookAt(lookAt)
|
||||||
|
.SetEase(Ease.InOutCubic);
|
||||||
|
}
|
||||||
|
}
|
||||||
12
UnityTests.Unity5/Assets/_Tests/Bugs/PathEndOffset.cs.meta
Normal file
12
UnityTests.Unity5/Assets/_Tests/Bugs/PathEndOffset.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c69115f54cce220428ca613714481679
|
||||||
|
timeCreated: 1499969527
|
||||||
|
licenseType: Pro
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
BIN
UnityTests.Unity5/Assets/_Tests/Bugs/PathEndOffset.unity
Normal file
BIN
UnityTests.Unity5/Assets/_Tests/Bugs/PathEndOffset.unity
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 24f20a4ce69764648ae39dece8014408
|
||||||
|
timeCreated: 1499969520
|
||||||
|
licenseType: Pro
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -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.615";
|
public static readonly string Version = "1.1.620";
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
// Options ////////////////////////////////////
|
// Options ////////////////////////////////////
|
||||||
|
|||||||
@ -232,9 +232,11 @@ namespace DG.Tweening
|
|||||||
&& (t.position < t.duration ? t.completedLoops % 2 != 0 : t.completedLoops % 2 == 0);
|
&& (t.position < t.duration ? t.completedLoops % 2 != 0 : t.completedLoops % 2 == 0);
|
||||||
|
|
||||||
// Get values from plugin and set them
|
// Get values from plugin and set them
|
||||||
UpdateNotice updateNotice =
|
bool isRewindStep = !wasRewinded && (
|
||||||
!wasRewinded && (t.loopType == LoopType.Restart && t.completedLoops != prevCompletedLoops || t.position <= 0 && t.completedLoops <= 0)
|
t.loopType == LoopType.Restart && t.completedLoops != prevCompletedLoops && (t.loops == -1 || t.completedLoops < t.loops)
|
||||||
? UpdateNotice.RewindStep : UpdateNotice.None;
|
|| t.position <= 0 && t.completedLoops <= 0
|
||||||
|
);
|
||||||
|
UpdateNotice updateNotice = isRewindStep ? UpdateNotice.RewindStep : UpdateNotice.None;
|
||||||
if (t.ApplyTween(prevPosition, prevCompletedLoops, newCompletedSteps, useInversePosition, updateMode, updateNotice)) return true;
|
if (t.ApplyTween(prevPosition, prevCompletedLoops, newCompletedSteps, useInversePosition, updateMode, updateNotice)) return true;
|
||||||
|
|
||||||
// Additional callbacks
|
// Additional callbacks
|
||||||
|
|||||||
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