Beispiel #1
0
    void Land(GameObject planet)
    {
        if (PlayerStates.canLand)
        {
            mainMusicController.GetComponent <DrumChanger>().RemoveDrum();
            _playerRigidbody.velocity        = Vector3.zero;
            _playerRigidbody.angularVelocity = 0;
            float angle = Vector3.SignedAngle(Vector3.up, playerShip.transform.position - planet.transform.position, Vector3.forward);



            _playerRigidbody.SetRotation(angle);
            _state.SetState(PlayerStates.States.InLandedShip);
            _state.SetPlanet(planet);

            planet.GetComponent <Planet>().LandOnPlanet(transform.parent.parent.gameObject);

            Player.transform.parent = planet.transform;
        }
    }