public void RunPickUpAnimation(Transform unitTransform) { glowFader?.Transit(1, 0, jumpDuration / 2); if (transformMover != null && transformScaler != null) { var highestPoint = modelTransform.localPosition; highestPoint.y = jumpMaxY; var lowestPoint = modelTransform.localPosition; lowestPoint.y = jumpMinY; SequenceNode <Vector3>[] positions = new SequenceNode <Vector3>[] { new SequenceNode <Vector3>() { value = highestPoint, duration = jumpDuration * jumpProportion, ease = DG.Tweening.Ease.InOutSine }, new SequenceNode <Vector3>() { value = lowestPoint, duration = jumpDuration * (1 - jumpProportion), ease = DG.Tweening.Ease.InOutSine } }; transformMover.MoveLocal(positions); SequenceNode <float>[] scales = new SequenceNode <float>[] { new SequenceNode <float>() { value = jumpScale, duration = jumpDuration * jumpProportion, ease = DG.Tweening.Ease.InOutFlash }, new SequenceNode <float>() { value = 0.05f, duration = jumpDuration * (1 - jumpProportion), ease = DG.Tweening.Ease.InOutFlash } }; transformScaler.Scale(scales); } if (followUnitRoutine != null) { StopCoroutine(followUnitRoutine); } followUnitRoutine = StartCoroutine(FollowUnitRoutine(unitTransform)); }
void MoveTo(Block targetBlock) { SwitchBlock(targetBlock); localMover.MoveLocal(Vector3.zero, moveDuration); }