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

[bugfix] Fixed SetLookAt and DOPath causing the target to end at the wrong position

This commit is contained in:
Demigiant 2017-07-13 20:32:53 +02:00
parent e9892b7704
commit 3aae3e29e7
46 changed files with 42 additions and 4 deletions

View 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);
}
}

View 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:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 24f20a4ce69764648ae39dece8014408
timeCreated: 1499969520
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -232,9 +232,11 @@ namespace DG.Tweening
&& (t.position < t.duration ? t.completedLoops % 2 != 0 : t.completedLoops % 2 == 0);
// Get values from plugin and set them
UpdateNotice updateNotice =
!wasRewinded && (t.loopType == LoopType.Restart && t.completedLoops != prevCompletedLoops || t.position <= 0 && t.completedLoops <= 0)
? UpdateNotice.RewindStep : UpdateNotice.None;
bool isRewindStep = !wasRewinded && (
t.loopType == LoopType.Restart && t.completedLoops != prevCompletedLoops && (t.loops == -1 || t.completedLoops < t.loops)
|| t.position <= 0 && t.completedLoops <= 0
);
UpdateNotice updateNotice = isRewindStep ? UpdateNotice.RewindStep : UpdateNotice.None;
if (t.ApplyTween(prevPosition, prevCompletedLoops, newCompletedSteps, useInversePosition, updateMode, updateNotice)) return true;
// Additional callbacks

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.