void StartAnimOrbitPosition() { float animTime = _orbitTimeStamp; LeanTween.move(gameObject, transform.up.normalized * _planet.GetOrbitPosition(_currentOrbit), animTime); _orbitMovement.AnimChangeOrbit = true; LeanTween.delayedCall(animTime, FinishAnimOrbitPosition); }
private void SetOrbitPosition() { if (!AnimChangeOrbit) { float orbitPosition = _planet.GetOrbitPosition(CurrentOrbit); Vector3 dirToPlanet = (transform.position - _planet.transform.position).normalized; transform.position = dirToPlanet * orbitPosition; transform.up = dirToPlanet; } }