コード例 #1
0
    void StartAnimOrbitPosition()
    {
        float animTime = _orbitTimeStamp;

        LeanTween.move(gameObject, transform.up.normalized * _planet.GetOrbitPosition(_currentOrbit), animTime);
        _orbitMovement.AnimChangeOrbit = true;
        LeanTween.delayedCall(animTime, FinishAnimOrbitPosition);
    }
コード例 #2
0
    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;
        }
    }