Пример #1
0
    private void Update()
    {
        lastAvatarPos = playerBody != null ? playerBody.transform.position : lastAvatarPos;

        if (!userMain.CursorOverUI())
        {
            if (inputControl.GetButtonDown("Action1"))
            {
                navigationControls.TryCaptureCursor();
            }
        }

        // Temporary band-aid guard, since this assumption runs deep.
        if (playerBody != null && navigationControls.userBody != null)
        {
            navigationControls.SetUserBodyVelocity(playerBody.GetVelocity());
            navigationControls.SetGrounded(playerBody.GetIsTouchingGround());
        }
        UpdatePlayUI();

        navigationControls.userBody.SetPlayerVisible(false);
    }