1 using System.Collections;
2 using System.Collections.Generic;
5 using UnityEngine.Events;
6 using UnityEngine.EventSystems;
14 namespace AVR.UEditor.UI {
16 [CanEditMultipleObjects]
21 base.OnInspectorGUI();
25 if(prov.UIRay==null) {
26 EditorGUILayout.HelpBox(
"UIInteractionProvider requires a UIRay to work!", MessageType.Warning);
27 if (GUILayout.Button(
"FIX NOW: Add default UIRay"))
29 GameObject ray = AVR.UEditor.Core.AVR_EditorUtility.InstantiatePrefabAsChild(prov.transform,
"/editor/defaultPrefabPaths/uiRay");
30 prov.UIRay = ray.GetComponent<
AVR_UIRay>();
35 if(FindObjectOfType<EventSystem>()==null) {
36 EditorGUILayout.HelpBox(
"UIInteractionProvider requires an EventSystem object to work!", MessageType.Warning);
37 if (GUILayout.Button(
"FIX NOW: Create EventSystem Object"))
39 AVR.UEditor.Core.AVR_EditorUtility.InstantiatePrefabAsChild(null,
"/editor/defaultPrefabPaths/eventSystem");
43 else if(FindObjectOfType<VRInput>()==null) {
44 EditorGUILayout.HelpBox(
"UIInteractionProvider requires a VRInput object to work!", MessageType.Warning);
45 EventSystem sys = FindObjectOfType<EventSystem>();
46 if (GUILayout.Button(
"FIX: Add VRInput Component to "+sys.name))
48 sys.gameObject.AddComponent<
VRInput>();
Represents a UI pointer-ray.
NOTE: If your EventSystem object has a InputSystemUIInputModule (new Unity input system) then any set...
override void OnInspectorGUI()