-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: distributed authority sample/expanded controls [MTT-9277] #256
base: develop
Are you sure you want to change the base?
feat: distributed authority sample/expanded controls [MTT-9277] #256
Conversation
{ nameof(MobileGamepadState.ButtonJump), MapRuntimeControl(m_JumpAction) }, | ||
{ nameof(MobileGamepadState.ButtonInteract), MapRuntimeControl(m_InteractAction) }, | ||
{ nameof(MobileGamepadState.ButtonSprint), MapRuntimeControl(m_SprintAction) }, | ||
// will re-visit to evaluate if this button is necessary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to revisit it in a later PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we'll revisit if we need this button in the UI icons PR.
public event Action<string, Vector2> JoystickStateChanged; | ||
|
||
/// <summary> | ||
/// This method let the UI updates when a property bound with <see cref="BindingMode.ToTarget"/> is calling it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"lets the UI update"
} | ||
|
||
/// <summary> | ||
/// This method lets the Input system updates when a property value is changed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here and below
/// The UI is bound to <see cref="RightJoystickTop"/> and <see cref="RightJoystickLeft"/> | ||
/// which converts the Vector2 position into a percent <see cref="StyleLength"/>. | ||
/// <para>The <see cref="TouchScreenBehaviour"/> is reading the UI pointer | ||
/// to directly write the delta in this property, which in returns updates the VisualElement position.</para> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo returns
The controller controls work well! With the mobile ones I have some issues:
|
What was challenging about the jumping? Is it something a follow-up PR could address? |
Description
This PR adds the skeleton mobile controls UI to the project. Mobile controls can be debugged inside the editor by toggling the following field inside the Bootstrap scene:
A result of this bootstrapping mobile work is that there's a wrapper between the UI and the project's inputs. So, at a high level, UI captures the value of a joystick or a button and routes them to the associated input system action. The result of this is some wrapper Input classes were removed or deprecated, as the game should fetch the input data from the new
GameInput
class, instead of referencing actions independently. The reason for this is thatInputSystemManager
now handles what platform the game is on and subsequently what control scheme to be on. Thus, reading from GameInput will track the currently enabled actions.Note: having a gamepad connected while debugging mobile controls will override both the virtual joystick inputs, so make sure to test gamepad when outside mobile debug mode.
Issue Number(s)
MTT-9277
Contribution checklist