Skip to content

Commit

Permalink
fix issue microsoft#2300 by setting TargetObject.transform instead of…
Browse files Browse the repository at this point in the history
… this.transform
  • Loading branch information
ForrestTrepte committed Jun 13, 2018
1 parent 0f9cff7 commit 5f42517
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ public void ResetTransform()
{
if (ToLocalTransform)
{
this.transform.localPosition = mStartValue;
TargetObject.transform.localPosition = mStartValue;
}
else
{
this.transform.position = mStartValue;
TargetObject.transform.position = mStartValue;
}
IsRunning = false;
mLerpTimeCounter = 0;
Expand Down Expand Up @@ -195,11 +195,11 @@ private void Update()

if (ToLocalTransform)
{
this.transform.localPosition = GetNewPosition(this.transform.localPosition, percent);
TargetObject.transform.localPosition = GetNewPosition(TargetObject.transform.localPosition, percent);
}
else
{
this.transform.position = GetNewPosition(this.transform.position, percent);
TargetObject.transform.position = GetNewPosition(TargetObject.transform.position, percent);
}

if (percent >= 1)
Expand All @@ -213,13 +213,13 @@ private void Update()
bool wasRunning = IsRunning;
if (ToLocalTransform)
{
this.transform.localPosition = GetNewPosition(this.transform.localPosition, LerpTime * Time.deltaTime);
IsRunning = this.transform.localPosition != TargetValue;
TargetObject.transform.localPosition = GetNewPosition(TargetObject.transform.localPosition, LerpTime * Time.deltaTime);
IsRunning = TargetObject.transform.localPosition != TargetValue;
}
else
{
this.transform.position = GetNewPosition(this.transform.position, LerpTime * Time.deltaTime);
IsRunning = this.transform.localPosition != TargetValue;
TargetObject.transform.position = GetNewPosition(TargetObject.transform.position, LerpTime * Time.deltaTime);
IsRunning = TargetObject.transform.localPosition != TargetValue;
}

if (IsRunning != wasRunning && !IsRunning)
Expand Down

0 comments on commit 5f42517

Please sign in to comment.