From 8d9eb13e54e60f54595350de9ec9649338a42517 Mon Sep 17 00:00:00 2001 From: Andreas Gawe Date: Wed, 16 Oct 2024 01:10:38 +0200 Subject: [PATCH] Added missing XR namespace. --- Assets/Resources/Prefabs/Players/XRRig.prefab | 3 +- .../Actions/AcceptDivergenceAction.cs | 3 +- Assets/SEE/Controls/Actions/AddEdgeAction.cs | 1 + Assets/SEE/Controls/Actions/AddNodeAction.cs | 1 + .../SEE/Controls/Actions/ContextMenuAction.cs | 1 + Assets/SEE/Controls/Actions/DeleteAction.cs | 1 + Assets/SEE/Controls/Actions/HideAction.cs | 1 + Assets/SEE/Controls/Actions/MoveAction.cs | 1 + .../Actions/NodeManipulationAction.cs | 1 + Assets/SEE/Controls/Actions/SelectAction.cs | 1 + Assets/SEE/Controls/Actions/ShowCodeAction.cs | 1 + Assets/SEE/Controls/Actions/ShowLabel.cs | 1 + Assets/SEE/Controls/SEEInput.cs | 1 + Assets/SEE/GameObjects/Menu/PlayerMenu.cs | 1 + Assets/SEE/UI/PopupMenu/PopupMenu.cs | 1 + .../PropertyWindowContextMenu.cs | 1 + .../UI/Window/TreeWindow/DesktopTreeWindow.cs | 1 + Assets/SEE/Utils/Raycasting.cs | 1 + Assets/SEE/XR/KeyboardInputHandler.cs | 49 +- Assets/SEE/XR/KeyboardKey.cs | 167 ++-- Assets/SEE/XR/KeyboardManager.cs | 167 ++-- Assets/SEE/XR/RadialSelection.cs | 748 +++++++++--------- Assets/SEE/XR/Rotator.cs | 323 ++++---- Assets/SEE/XR/XRSEEActions.cs | 401 +++++----- 24 files changed, 955 insertions(+), 922 deletions(-) diff --git a/Assets/Resources/Prefabs/Players/XRRig.prefab b/Assets/Resources/Prefabs/Players/XRRig.prefab index d82cf3b294..957f67085f 100644 --- a/Assets/Resources/Prefabs/Players/XRRig.prefab +++ b/Assets/Resources/Prefabs/Players/XRRig.prefab @@ -3324,7 +3324,7 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 0 m_CallState: 2 - radialMenu: {fileID: -5982496924579745919, guid: c348712bda248c246b8c49b3db54643f, + RadialMenuActionRef: {fileID: -5982496924579745919, guid: c348712bda248c246b8c49b3db54643f, type: 3} --- !u!1 &7806924667908141112 GameObject: @@ -5196,7 +5196,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: df5e8c7d8b96d6944aaafef73a15f5b0, type: 3} m_Name: m_EditorClassIdentifier: - m_RayInteractor: {fileID: 645861538944586177} inputAction: {fileID: -1379689384741821685, guid: c348712bda248c246b8c49b3db54643f, type: 3} undo: {fileID: -989603093121905207, guid: c348712bda248c246b8c49b3db54643f, type: 3} diff --git a/Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs b/Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs index 846173d9df..1f522ff174 100644 --- a/Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs +++ b/Assets/SEE/Controls/Actions/AcceptDivergenceAction.cs @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.Linq; using UnityEngine; +using SEE.XR; namespace SEE.Controls.Actions { @@ -116,7 +117,7 @@ public override bool Update() { if (SceneSettings.InputType == PlayerInputType.VRPlayer) { - if (XRSEEActions.Selected + if (XRSEEActions.Selected && XRSEEActions.RayInteractor.TryGetCurrent3DRaycastHit(out RaycastHit hit)) { // find the edge representing the divergence that should be solved. diff --git a/Assets/SEE/Controls/Actions/AddEdgeAction.cs b/Assets/SEE/Controls/Actions/AddEdgeAction.cs index fd8a0f42aa..48ee5a6596 100644 --- a/Assets/SEE/Controls/Actions/AddEdgeAction.cs +++ b/Assets/SEE/Controls/Actions/AddEdgeAction.cs @@ -10,6 +10,7 @@ using SEE.Audio; using SEE.DataModel.DG; using SEE.Game.SceneManipulation; +using SEE.XR; namespace SEE.Controls.Actions { diff --git a/Assets/SEE/Controls/Actions/AddNodeAction.cs b/Assets/SEE/Controls/Actions/AddNodeAction.cs index 826a4f340d..3265bf9b74 100644 --- a/Assets/SEE/Controls/Actions/AddNodeAction.cs +++ b/Assets/SEE/Controls/Actions/AddNodeAction.cs @@ -9,6 +9,7 @@ using System; using SEE.UI.PropertyDialog; using SEE.DataModel.DG; +using SEE.XR; namespace SEE.Controls.Actions { diff --git a/Assets/SEE/Controls/Actions/ContextMenuAction.cs b/Assets/SEE/Controls/Actions/ContextMenuAction.cs index 48c8c6c462..fd5f318e2d 100644 --- a/Assets/SEE/Controls/Actions/ContextMenuAction.cs +++ b/Assets/SEE/Controls/Actions/ContextMenuAction.cs @@ -17,6 +17,7 @@ using SEE.GO.Menu; using SEE.UI.Menu.Drawable; using SEE.UI.Window.PropertyWindow; +using SEE.XR; namespace SEE.Controls.Actions { diff --git a/Assets/SEE/Controls/Actions/DeleteAction.cs b/Assets/SEE/Controls/Actions/DeleteAction.cs index 30c953d6e8..4f0b192c7b 100644 --- a/Assets/SEE/Controls/Actions/DeleteAction.cs +++ b/Assets/SEE/Controls/Actions/DeleteAction.cs @@ -8,6 +8,7 @@ using SEE.Audio; using SEE.Game.SceneManipulation; using SEE.Utils.History; +using SEE.XR; namespace SEE.Controls.Actions { diff --git a/Assets/SEE/Controls/Actions/HideAction.cs b/Assets/SEE/Controls/Actions/HideAction.cs index cce5ac7909..55ff682297 100644 --- a/Assets/SEE/Controls/Actions/HideAction.cs +++ b/Assets/SEE/Controls/Actions/HideAction.cs @@ -7,6 +7,7 @@ using UnityEngine; using UnityEngine.Assertions; using SEE.Utils.History; +using SEE.XR; namespace SEE.Controls.Actions { diff --git a/Assets/SEE/Controls/Actions/MoveAction.cs b/Assets/SEE/Controls/Actions/MoveAction.cs index d9befd1768..64b24523bd 100644 --- a/Assets/SEE/Controls/Actions/MoveAction.cs +++ b/Assets/SEE/Controls/Actions/MoveAction.cs @@ -15,6 +15,7 @@ using SEE.Utils.History; using UnityEngine; using UnityEngine.EventSystems; +using SEE.XR; namespace SEE.Controls.Actions diff --git a/Assets/SEE/Controls/Actions/NodeManipulationAction.cs b/Assets/SEE/Controls/Actions/NodeManipulationAction.cs index 309f602b1a..c63b6425b0 100644 --- a/Assets/SEE/Controls/Actions/NodeManipulationAction.cs +++ b/Assets/SEE/Controls/Actions/NodeManipulationAction.cs @@ -9,6 +9,7 @@ using SEE.Utils.History; using System.Collections.Generic; using UnityEngine; +using SEE.XR; namespace SEE.Controls.Actions { diff --git a/Assets/SEE/Controls/Actions/SelectAction.cs b/Assets/SEE/Controls/Actions/SelectAction.cs index b0606a0f9b..11ec58733a 100644 --- a/Assets/SEE/Controls/Actions/SelectAction.cs +++ b/Assets/SEE/Controls/Actions/SelectAction.cs @@ -4,6 +4,7 @@ using UnityEngine; using SEE.Audio; using SEE.GO; +using SEE.XR; namespace SEE.Controls.Actions { diff --git a/Assets/SEE/Controls/Actions/ShowCodeAction.cs b/Assets/SEE/Controls/Actions/ShowCodeAction.cs index 78c294e06f..463e533975 100644 --- a/Assets/SEE/Controls/Actions/ShowCodeAction.cs +++ b/Assets/SEE/Controls/Actions/ShowCodeAction.cs @@ -14,6 +14,7 @@ using SEE.Utils.History; using SEE.Game.City; using SEE.VCS; +using SEE.XR; using GraphElementRef = SEE.GO.GraphElementRef; using Range = SEE.DataModel.DG.Range; diff --git a/Assets/SEE/Controls/Actions/ShowLabel.cs b/Assets/SEE/Controls/Actions/ShowLabel.cs index a24c896cd8..2c2b49b77d 100644 --- a/Assets/SEE/Controls/Actions/ShowLabel.cs +++ b/Assets/SEE/Controls/Actions/ShowLabel.cs @@ -6,6 +6,7 @@ using SEE.Game.Operator; using SEE.GO; using UnityEngine; +using SEE.XR; namespace SEE.Controls.Actions { diff --git a/Assets/SEE/Controls/SEEInput.cs b/Assets/SEE/Controls/SEEInput.cs index d48ca989d5..4949199b23 100644 --- a/Assets/SEE/Controls/SEEInput.cs +++ b/Assets/SEE/Controls/SEEInput.cs @@ -2,6 +2,7 @@ using SEE.Utils; using UnityEngine; using SEE.GO; +using SEE.XR; namespace SEE.Controls { diff --git a/Assets/SEE/GameObjects/Menu/PlayerMenu.cs b/Assets/SEE/GameObjects/Menu/PlayerMenu.cs index f4c338cb43..4813ba0500 100644 --- a/Assets/SEE/GameObjects/Menu/PlayerMenu.cs +++ b/Assets/SEE/GameObjects/Menu/PlayerMenu.cs @@ -8,6 +8,7 @@ using SEE.UI.StateIndicator; using SEE.Utils; using UnityEngine; +using SEE.XR; namespace SEE.GO.Menu { diff --git a/Assets/SEE/UI/PopupMenu/PopupMenu.cs b/Assets/SEE/UI/PopupMenu/PopupMenu.cs index f5da016dcc..0fb9636d27 100644 --- a/Assets/SEE/UI/PopupMenu/PopupMenu.cs +++ b/Assets/SEE/UI/PopupMenu/PopupMenu.cs @@ -10,6 +10,7 @@ using TMPro; using UnityEngine; using UnityEngine.UI; +using SEE.XR; namespace SEE.UI.PopupMenu { diff --git a/Assets/SEE/UI/Window/PropertyWindow/PropertyWindowContextMenu.cs b/Assets/SEE/UI/Window/PropertyWindow/PropertyWindowContextMenu.cs index 34e49db663..7c17499681 100644 --- a/Assets/SEE/UI/Window/PropertyWindow/PropertyWindowContextMenu.cs +++ b/Assets/SEE/UI/Window/PropertyWindow/PropertyWindowContextMenu.cs @@ -10,6 +10,7 @@ using TMPro; using UnityEngine; using UnityEngine.Events; +using SEE.XR; namespace SEE.UI.Window.PropertyWindow { diff --git a/Assets/SEE/UI/Window/TreeWindow/DesktopTreeWindow.cs b/Assets/SEE/UI/Window/TreeWindow/DesktopTreeWindow.cs index 1a7a17f345..3bb2287793 100644 --- a/Assets/SEE/UI/Window/TreeWindow/DesktopTreeWindow.cs +++ b/Assets/SEE/UI/Window/TreeWindow/DesktopTreeWindow.cs @@ -16,6 +16,7 @@ using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; +using SEE.XR; using ArgumentException = System.ArgumentException; using Edge = SEE.DataModel.DG.Edge; using Node = SEE.DataModel.DG.Node; diff --git a/Assets/SEE/Utils/Raycasting.cs b/Assets/SEE/Utils/Raycasting.cs index 8f57f8a24b..45362bf88b 100644 --- a/Assets/SEE/Utils/Raycasting.cs +++ b/Assets/SEE/Utils/Raycasting.cs @@ -7,6 +7,7 @@ using UnityEngine.EventSystems; using UnityEngine.InputSystem; using UnityEngine.InputSystem.UI; +using SEE.XR; namespace SEE.Utils { diff --git a/Assets/SEE/XR/KeyboardInputHandler.cs b/Assets/SEE/XR/KeyboardInputHandler.cs index b44b526a8d..fd71ee5660 100644 --- a/Assets/SEE/XR/KeyboardInputHandler.cs +++ b/Assets/SEE/XR/KeyboardInputHandler.cs @@ -4,35 +4,38 @@ using UnityEngine; using UnityEngine.EventSystems; -/// -/// This class changes the inputfield for the VR-Keyboard and -/// also activates the keyboard. -/// This script is based on this tutorial: https://www.youtube.com/watch?v=vTonHBr4t4g -/// -public class KeyboardInputHandler : MonoBehaviour, IPointerClickHandler +namespace SEE.XR { /// - /// The reference to the keyboard GameObject. + /// This class changes the inputfield for the VR-Keyboard and + /// also activates the keyboard. + /// This script is based on this tutorial: https://www.youtube.com/watch?v=vTonHBr4t4g /// - private GameObject keyboardGameObject; - - private void Start() + public class KeyboardInputHandler : MonoBehaviour, IPointerClickHandler { - // Cache the reference to the keyboard GameObject - keyboardGameObject = KeyboardManager.instance.gameObject.transform.Find("Keyboard").gameObject; - } + /// + /// The reference to the keyboard GameObject. + /// + private GameObject keyboardGameObject; - /// - /// This method gets called when the user clicks the input field. - /// If the user is in VR, the keyboard gets activated. - /// - /// Event data associated with the event when the user clicks on the inputfield. - public void OnPointerClick(PointerEventData eventdata) - { - if (SceneSettings.InputType == PlayerInputType.VRPlayer) + private void Start() + { + // Cache the reference to the keyboard GameObject + keyboardGameObject = KeyboardManager.instance.gameObject.transform.Find("Keyboard").gameObject; + } + + /// + /// This method gets called when the user clicks the input field. + /// If the user is in VR, the keyboard gets activated. + /// + /// Event data associated with the event when the user clicks on the inputfield. + public void OnPointerClick(PointerEventData eventdata) { - KeyboardManager.instance.inputField = GetComponent(); - keyboardGameObject.SetActive(true); + if (SceneSettings.InputType == PlayerInputType.VRPlayer) + { + KeyboardManager.instance.inputField = GetComponent(); + keyboardGameObject.SetActive(true); + } } } } diff --git a/Assets/SEE/XR/KeyboardKey.cs b/Assets/SEE/XR/KeyboardKey.cs index 89b242eb88..5684eb8311 100644 --- a/Assets/SEE/XR/KeyboardKey.cs +++ b/Assets/SEE/XR/KeyboardKey.cs @@ -2,106 +2,109 @@ using UnityEngine; using UnityEngine.UI; -/// -/// This class handles a single keyboard key. -/// This script is based on this tutorial: https://www.youtube.com/watch?v=vTonHBr4t4g -/// -public class KeyboardKey : MonoBehaviour +namespace SEE.XR { /// - /// The character of the key. + /// This class handles a single keyboard key. + /// This script is based on this tutorial: https://www.youtube.com/watch?v=vTonHBr4t4g /// - public string character; - - /// - /// The shifted character. - /// - public string shiftCharacter; - - /// - /// Is true when the key is shifted. - /// - private bool isShifted = false; + public class KeyboardKey : MonoBehaviour + { + /// + /// The character of the key. + /// + public string character; - /// - /// The actual keyboard key. - /// - private Button key; + /// + /// The shifted character. + /// + public string shiftCharacter; - /// - /// The label of the keyboard key. - /// - public TextMeshProUGUI keyLabel; + /// + /// Is true when the key is shifted. + /// + private bool isShifted = false; - private void Start() - { - KeyboardManager.instance.shiftButton.onClick.AddListener(HandleShift); - key = GetComponent