diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs index 667a833494..92733de82e 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/UI/InputSystemUIInputModule.cs @@ -31,8 +31,6 @@ ////TODO: add ability to query which device was last used with any of the actions ////REVIEW: also give access to the last/current UI event? -////TODO: ToString() method a la PointerInputModule - namespace UnityEngine.InputSystem.UI { /// @@ -2616,6 +2614,22 @@ public InputActionAsset actionsAsset } } + public override string ToString() + { + System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder("Pointer Input Module of type: " + (object) this.GetType()); + stringBuilder.AppendLine(); + + foreach (PointerModel keyValuePair in this.m_PointerStates) + { + if (keyValuePair.eventData != null) + { + stringBuilder.AppendLine("Pointer: " + (object) keyValuePair.screenPosition); + stringBuilder.AppendLine(keyValuePair.eventData.ToString()); + } + } + return stringBuilder.ToString(); + } + [SerializeField, HideInInspector] private InputActionAsset m_ActionsAsset; [SerializeField, HideInInspector] private InputActionReference m_PointAction; [SerializeField, HideInInspector] private InputActionReference m_MoveAction;