public static Tweener SetSpeedBased(this TweenerCore <Angle, Angle, AngleOptions> t, AngularVelocityUnit unit) { if (t == null || !t.active) { return(t); } t.SetSpeedBased(); t.plugOptions.AngularVelocityUnit = unit; return(t); }
public void play(Unit unit, string pathName, bool autoPaly, bool inverse) { start(unit); Vector3[] path = iTweenPath.GetPath(pathName); if (inverse) { System.Array.Reverse(path); } Vector3 d = path[0] - vTarget; for (int i = 0; i < path.Length; ++i) { path[i] = path[i] - d; } mPathTween = unit.transform.DOPath(path, mSpeed, PathType.CatmullRom, PathMode.Full3D); if (!autoPaly) { mPathTween.Pause(); } mPathTween.SetSpeedBased(true); mPathTween.timeScale = unit.scale; mPathTween.SetLookAt(0).SetEase(Ease.Linear).OnWaypointChange(onWaypointChange).OnComplete(delegate { mPathTween = null; }); }