File tree Expand file tree Collapse file tree 3 files changed +21
-63
lines changed
Packages/com.unity.inputsystem/InputSystem/Plugins/OnScreen Expand file tree Collapse file tree 3 files changed +21
-63
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,7 @@ protected void SendValueToControl<TValue>(TValue value)
203
203
////FIXME: this gives us a one-frame lag (use InputState.Change instead?)
204
204
m_InputEventPtr . internalTime = InputRuntime . s_Instance . currentTime ;
205
205
control . WriteValueIntoEvent ( value , m_InputEventPtr ) ;
206
- //InputSystem.QueueEvent(m_InputEventPtr);
207
- InputState . Change ( m_Control . m_Device , m_InputEventPtr ) ;
206
+ InputSystem . QueueEvent ( m_InputEventPtr ) ;
208
207
}
209
208
210
209
protected void SentDefaultValueToControl ( )
@@ -347,4 +346,24 @@ internal string GetWarningMessage()
347
346
return $ "{ GetType ( ) } needs to be attached as a child to a UI Canvas and have a RectTransform component to function properly.";
348
347
}
349
348
}
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
350
369
}
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments