Skip to content

Commit 9276825

Browse files
committed
Undo changes not related to rebind sample extension.
1 parent ccfd328 commit 9276825

File tree

3 files changed

+21
-63
lines changed

3 files changed

+21
-63
lines changed

Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen/OnScreenControl.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,7 @@ protected void SendValueToControl<TValue>(TValue value)
203203
////FIXME: this gives us a one-frame lag (use InputState.Change instead?)
204204
m_InputEventPtr.internalTime = InputRuntime.s_Instance.currentTime;
205205
control.WriteValueIntoEvent(value, m_InputEventPtr);
206-
//InputSystem.QueueEvent(m_InputEventPtr);
207-
InputState.Change(m_Control.m_Device, m_InputEventPtr);
206+
InputSystem.QueueEvent(m_InputEventPtr);
208207
}
209208

210209
protected void SentDefaultValueToControl()
@@ -347,4 +346,24 @@ internal string GetWarningMessage()
347346
return $"{GetType()} needs to be attached as a child to a UI Canvas and have a RectTransform component to function properly.";
348347
}
349348
}
349+
350+
internal static class UGUIOnScreenControlUtils
351+
{
352+
public static RectTransform GetCanvasRectTransform(Transform transform)
353+
{
354+
var parentTransform = transform.parent;
355+
return parentTransform != null ? transform.parent.GetComponentInParent<RectTransform>() : null;
356+
}
357+
}
358+
359+
#if UNITY_EDITOR
360+
internal static class UGUIOnScreenControlEditorUtils
361+
{
362+
public static void ShowWarningIfNotPartOfCanvasHierarchy(OnScreenControl target)
363+
{
364+
if (UGUIOnScreenControlUtils.GetCanvasRectTransform(target.transform) == null)
365+
UnityEditor.EditorGUILayout.HelpBox(target.GetWarningMessage(), UnityEditor.MessageType.Warning);
366+
}
367+
}
368+
#endif
350369
}

Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen/OnScreenHelpers.cs

Lines changed: 0 additions & 58 deletions
This file was deleted.

Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen/OnScreenHelpers.cs.meta

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)