Skip to content

Commit

Permalink
Merge branch 'develop' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ekcoh authored Jun 27, 2024
2 parents 3155247 + d9e3c6e commit f75bb65
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,6 @@ Input Action Assets can have multiple [Control Schemes](ActionBindings.md#contro

![Control Scheme Properties](Images/ControlSchemeProperties.png)

To see the Control Schemes in the Input Action Asset editor window, open the Control Scheme drop-down list in the top left of the window. This menu lets you add or remove Control Schemes to your Asset. If the Asset contains any Control Schemes, you can select a Control Scheme, and then the window only shows bindings that are associated with that Scheme. If you select a binding, you can now pick the Control Schemes for which this binding should be active in the __Properties__ view to the left of the window. When you add a new Control Scheme, or select an existing Control Scheme, and then select __Edit Control Scheme…__, you can edit the name of the Control Scheme and which devices the Scheme should be active for.
To see the Control Schemes in the Input Action Asset editor window, open the Control Scheme drop-down list in the top left of the window. This menu lets you add or remove Control Schemes to your Actions Asset. If the Actions Asset contains any Control Schemes, you can select a Control Scheme, and then the window only shows bindings that are associated with that Scheme. If you select a binding, you can now pick the Control Schemes for which this binding should be active in the __Properties__ view to the left of the window.

When you add a new Control Scheme, or select an existing Control Scheme, and then select __Edit Control Scheme__, you can edit the name of the Control Scheme and which devices the Scheme should be active for. When you add a new Control Scheme, the "Device Type" list is empty by default (as shown above). You must add at least one type of device to this list for the Control Scheme to be functional.
Original file line number Diff line number Diff line change
Expand Up @@ -1298,12 +1298,21 @@ private static void LoadBindingOverridesFromJsonInternal(this IInputActionCollec
///
/// <example>
/// <code>
/// // A MonoBehaviour that can be hooked up to a UI.Button control.
/// using TMPro;
/// using UnityEngine;
/// using UnityEngine.InputSystem;
///
/// public class RebindButton : MonoBehaviour
/// {
/// public InputActionReference m_Action; // Reference to an action to rebind.
/// public int m_BindingIndex; // Index into m_Action.bindings for binding to rebind.
/// public Text m_DisplayText; // Text in UI that receives the binding display string.
///
/// // A MonoBehaviour that can be hooked up to a UI.Button control.
/// // This example requires you to set up a Text Mesh Pro text field,
/// // And a UI button which calls the OnClick method in this script.
///
/// public InputActionReference actionReference; // Reference to an action to rebind.
/// public int bindingIndex; // Index into m_Action.bindings for binding to rebind.
/// public TextMeshProUGUI displayText; // Text in UI that receives the binding display string.
/// private InputActionRebindingExtensions.RebindingOperation rebind;
///
/// public void OnEnable()
/// {
Expand All @@ -1312,26 +1321,20 @@ private static void LoadBindingOverridesFromJsonInternal(this IInputActionCollec
///
/// public void OnDisable()
/// {
/// m_Rebind?.Dispose();
/// rebind?.Dispose();
/// }
///
/// public void OnClick()
/// {
/// var rebind = m_Action.PerformInteractiveRebinding()
/// .WithTargetBinding(m_BindingIndex)
/// .OnComplete(_ => UpdateDisplayText())
/// .Start();
/// var rebind = actionReference.action.PerformInteractiveRebinding().WithTargetBinding(bindingIndex).OnComplete(_ => UpdateDisplayText());
/// rebind.Start();
/// }
///
/// private void UpdateDisplayText()
/// {
/// m_DisplayText.text = m_Action.GetBindingDisplayString(m_BindingIndex);
/// displayText.text = actionReference.action.GetBindingDisplayString(bindingIndex);
/// }
///
/// private void RebindingOperation m_Rebind;
/// }
///
/// rebind.Start();
/// </code>
/// </example>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
namespace UnityEngine.InputSystem.Controls
{
/// <summary>
/// A control representing a two-dimensional motion vector that accumulates within a frame
/// and resets at the beginning of a frame.
/// Delta controls are a two-dimensional motion vector that accumulate within a frame
/// and reset at the beginning of a frame. You can read the values from a delta control
/// using the inherited members from Vector2Control or InputControl.
/// </summary>
/// <remarks>
/// Delta controls are
/// </remarks>
/// <see cref="Pointer.delta"/>
/// <seealso cref="Mouse.scroll"/>
[Preserve]
Expand All @@ -27,7 +25,7 @@ public class DeltaControl : Vector2Control
public AxisControl up { get; set; }

/// <summary>
/// A synthetic axis representing the lower half of the Y axis value, i.e. the -1 to 1 range (inverted).
/// A synthetic axis representing the lower half of the Y axis value, i.e. the 0 to -1 range (inverted).
/// </summary>
/// <value>Control representing the control's lower half Y axis.</value>
/// <remarks>
Expand All @@ -38,7 +36,7 @@ public class DeltaControl : Vector2Control
public AxisControl down { get; set; }

/// <summary>
/// A synthetic axis representing the left half of the X axis value, i.e. the -1 to 1 range (inverted).
/// A synthetic axis representing the left half of the X axis value, i.e. the 0 to -1 range (inverted).
/// </summary>
/// <value>Control representing the control's left half X axis.</value>
/// <remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected override void FinishSetup()
/// Input device representing a gyroscope sensor.
/// </summary>
/// <remarks>
/// A gyroscope let's you measure the angular velocity of a device, and can be useful to control content by rotating a device.
/// A gyroscope lets you measure the angular velocity of a device, and can be useful to control content by rotating a device.
/// </remarks>
[InputControlLayout(stateType = typeof(GyroscopeState))]
public class Gyroscope : Sensor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ public enum PlayerJoinBehavior
/// are involved. While initial engagement required by <see cref="JoinPlayersWhenButtonIsPressed"/> or
/// <see cref="JoinPlayersWhenJoinActionIsTriggered"/> allows pairing a single device reliably to a player,
/// additional devices that may be required by a control scheme will still get paired automatically out of the
/// pool of available devices. This means that, for example, if a given player joins by clicking a mouse button
/// ...
/// pool of available devices.
/// </remarks>
JoinPlayersManually,
}
Expand Down
11 changes: 4 additions & 7 deletions Packages/com.unity.inputsystem/InputSystem/State/InputState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,19 +180,17 @@ public static bool IsIntegerFormat(this FourCC format)
/// InputState.AddChangeMonitor(Mouse.current.rightButton, this, monitorIndex: 2);
/// }
///
/// public void NotifyControlStateChanged(InputControl control, double time, InputEventPtr eventPtr, long monitorIndex)
/// public void NotifyControlStateChanged(InputControl control, double currentTime, InputEventPtr eventPtr, long monitorIndex)
/// {
/// Debug.Log($"{control} changed");
///
/// // We can add a monitor timeout that will trigger in case the state of the
/// // given control is not changed within the given time. Let's watch the control
/// // for 2 seconds. If nothing happens, we will get a call to NotifyTimerExpired.
/// // If, however, there is a state change, the timeout is automatically removed
/// // and we will see a call to NotifyControlStateChanged instead.
/// InputState.AddChangeMonitorTimeout(control, this, 2);
/// InputState.AddChangeMonitorTimeout(control, this, currentTime + 2);
/// }
///
/// public void NotifyTimerExpired(InputControl control, double time, long monitorIndex, int timerIndex)
/// public void NotifyTimerExpired(InputControl control, double currentTime, long monitorIndex, int timerIndex)
/// {
/// Debug.Log($"{control} was not changed within 2 seconds");
/// }
Expand Down Expand Up @@ -248,8 +246,7 @@ public static void RemoveChangeMonitor(InputControl control, IInputStateChangeMo
/// <remarks>
/// If by the given <paramref name="time"/>, no state change has been registered on the control monitored
/// by the given <paramref name="monitor">state change monitor</paramref>, <see cref="IInputStateChangeMonitor.NotifyTimerExpired"/>
/// will be called on <paramref name="monitor"/>. If a state change happens by the given <paramref name="time"/>,
/// the monitor is notified as usual and the timer is automatically removed.
/// will be called on <paramref name="monitor"/>.
/// </remarks>
public static void AddChangeMonitorTimeout(InputControl control, IInputStateChangeMonitor monitor, double time, long monitorIndex = -1, int timerIndex = -1)
{
Expand Down

0 comments on commit f75bb65

Please sign in to comment.