├── .gitignore ├── AssemblyInfo.cs ├── AssemblyInfo.cs.meta ├── Demo.meta ├── Demo ├── MyModalContent.cs ├── MyModalContent.cs.meta ├── XRUIDemo.cs ├── XRUIDemo.cs.meta ├── XRUIDemo.unity ├── XRUIDemo.unity.meta ├── XRUIDemoWorldUIInteraction.unity └── XRUIDemoWorldUIInteraction.unity.meta ├── Documentation.meta ├── Documentation ├── api.meta ├── api │ ├── .manifest │ ├── com.chwar.xrui.UIElements.WorldUIParameters.yml │ ├── com.chwar.xrui.UIElements.WorldUIParameters.yml.meta │ ├── com.chwar.xrui.UIElements.XRUIAlert.AlertType.yml │ ├── com.chwar.xrui.UIElements.XRUIAlert.yml │ ├── com.chwar.xrui.UIElements.XRUIAlert.yml.meta │ ├── com.chwar.xrui.UIElements.XRUICard.yml │ ├── com.chwar.xrui.UIElements.XRUICard.yml.meta │ ├── com.chwar.xrui.UIElements.XRUIContextualMenu.yml │ ├── com.chwar.xrui.UIElements.XRUIContextualMenu.yml.meta │ ├── com.chwar.xrui.UIElements.XRUIElement.yml │ ├── com.chwar.xrui.UIElements.XRUIElement.yml.meta │ ├── com.chwar.xrui.UIElements.XRUIFormatOverride.yml │ ├── com.chwar.xrui.UIElements.XRUIList.yml │ ├── com.chwar.xrui.UIElements.XRUIList.yml.meta │ ├── com.chwar.xrui.UIElements.XRUIMenu.yml │ ├── com.chwar.xrui.UIElements.XRUIMenu.yml.meta │ ├── com.chwar.xrui.UIElements.XRUIModal.yml │ ├── com.chwar.xrui.UIElements.XRUIModal.yml.meta │ ├── com.chwar.xrui.UIElements.XRUINavbar.yml │ ├── com.chwar.xrui.UIElements.XRUINavbar.yml.meta │ ├── com.chwar.xrui.UIElements.yml │ ├── com.chwar.xrui.UIElements.yml.meta │ ├── com.chwar.xrui.XRUI.AlertType.yml.meta │ ├── com.chwar.xrui.XRUI.XRUIFormat.yml │ ├── com.chwar.xrui.XRUI.XRUIFormat.yml.meta │ ├── com.chwar.xrui.XRUI.yml │ ├── com.chwar.xrui.XRUI.yml.meta │ ├── com.chwar.xrui.XRUIConfiguration.yml │ ├── com.chwar.xrui.XRUIConfiguration.yml.meta │ ├── com.chwar.xrui.XRUIGridController.XRUIGrid.yml │ ├── com.chwar.xrui.XRUIGridController.XRUIGrid.yml.meta │ ├── com.chwar.xrui.XRUIGridController.yml │ ├── com.chwar.xrui.XRUIGridController.yml.meta │ ├── com.chwar.xrui.XRUIPanel.yml │ ├── com.chwar.xrui.XRUIPanel.yml.meta │ ├── com.chwar.xrui.XRUIWorldSpaceInteraction.yml │ ├── com.chwar.xrui.XRUIWorldSpaceInteraction.yml.meta │ ├── com.chwar.xrui.yml │ ├── com.chwar.xrui.yml.meta │ ├── toc.yml │ └── toc.yml.meta ├── docfx.json ├── docfx.json.meta ├── filterConfig.yml ├── filterConfig.yml.meta ├── index.md ├── index.md.meta ├── manual.meta ├── obj.meta ├── resources.meta ├── toc.yml └── toc.yml.meta ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Resources.meta ├── Resources ├── Buttons.uss ├── Buttons.uss.meta ├── Default2DPanelSettings.asset ├── Default2DPanelSettings.asset.meta ├── DefaultAlert.uss ├── DefaultAlert.uss.meta ├── DefaultAlert.uxml ├── DefaultAlert.uxml.meta ├── DefaultCard.uss ├── DefaultCard.uss.meta ├── DefaultCard.uxml ├── DefaultCard.uxml.meta ├── DefaultContextualMenu.uss ├── DefaultContextualMenu.uss.meta ├── DefaultContextualMenu.uxml ├── DefaultContextualMenu.uxml.meta ├── DefaultContextualMenuElement.uxml ├── DefaultContextualMenuElement.uxml.meta ├── DefaultList.uss ├── DefaultList.uss.meta ├── DefaultList.uxml ├── DefaultList.uxml.meta ├── DefaultListElement.uss ├── DefaultListElement.uss.meta ├── DefaultListElement.uxml ├── DefaultListElement.uxml.meta ├── DefaultMenu.uss ├── DefaultMenu.uss.meta ├── DefaultMenu.uxml ├── DefaultMenu.uxml.meta ├── DefaultMenuElement.uxml ├── DefaultMenuElement.uxml.meta ├── DefaultModal.uss ├── DefaultModal.uss.meta ├── DefaultModal.uxml ├── DefaultModal.uxml.meta ├── DefaultNavBar.uss ├── DefaultNavBar.uss.meta ├── DefaultNavBar.uxml ├── DefaultNavBar.uxml.meta ├── DefaultWorldUIPanelSettings.asset ├── DefaultWorldUIPanelSettings.asset.meta ├── DefaultXRUI2DConfiguration.asset ├── DefaultXRUI2DConfiguration.asset.meta ├── DefaultXRUIWorldUIConfiguration.asset ├── DefaultXRUIWorldUIConfiguration.asset.meta ├── OpenSans-Light.ttf ├── OpenSans-Light.ttf.meta ├── Roboto-Regular.ttf ├── Roboto-Regular.ttf.meta ├── Scrollbar.uss ├── Scrollbar.uss.meta ├── Templates.meta ├── Templates │ ├── Button.uxml │ ├── Button.uxml.meta │ ├── Separator.uxml │ ├── Separator.uxml.meta │ ├── TextFieldWithButton.uxml │ └── TextFieldWithButton.uxml.meta ├── TestUIElement.uxml ├── TestUIElement.uxml.meta ├── XRUI.uss ├── XRUI.uss.meta ├── XRUIRoot.uxml ├── XRUIRoot.uxml.meta ├── XRUIRuntimeTheme.tss └── XRUIRuntimeTheme.tss.meta ├── Scripts.meta ├── Scripts ├── Editor.meta ├── Editor │ ├── XRUIEditor.cs │ ├── XRUIEditor.cs.meta │ └── obj.meta ├── UIElements.meta ├── UIElements │ ├── XRUIAlert.cs │ ├── XRUIAlert.cs.meta │ ├── XRUICard.cs │ ├── XRUICard.cs.meta │ ├── XRUIContextualMenu.cs │ ├── XRUIContextualMenu.cs.meta │ ├── XRUIElement.cs │ ├── XRUIElement.cs.meta │ ├── XRUIList.cs │ ├── XRUIList.cs.meta │ ├── XRUIMenu.cs │ ├── XRUIMenu.cs.meta │ ├── XRUIModal.cs │ ├── XRUIModal.cs.meta │ ├── XRUINavbar.cs │ └── XRUINavbar.cs.meta ├── XRUI.cs ├── XRUI.cs.meta ├── XRUIConfiguration.cs ├── XRUIConfiguration.cs.meta ├── XRUIGridController.cs ├── XRUIGridController.cs.meta ├── XRUIPanel.cs ├── XRUIPanel.cs.meta ├── XRUIWorldSpaceInteraction.cs └── XRUIWorldSpaceInteraction.cs.meta ├── Tests.meta ├── Tests ├── AlertTest.cs ├── AlertTest.cs.meta ├── ContextualMenuTest.cs ├── ContextualMenuTest.cs.meta ├── Editor.meta ├── Editor │ ├── Editor.asmdef │ ├── Editor.asmdef.meta │ ├── XRUIEditorTest.cs │ └── XRUIEditorTest.cs.meta ├── ModalTest.cs ├── ModalTest.cs.meta ├── Tests.asmdef ├── Tests.asmdef.meta ├── XRUIElementsTest.cs ├── XRUIElementsTest.cs.meta ├── XRUITest.cs └── XRUITest.cs.meta ├── com.chwar.xrui.asmdef ├── com.chwar.xrui.asmdef.meta ├── package.json └── package.json.meta /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | /[Dd]ocumentation/obj/ 13 | /[Ss]cripts/Editor/obj/ 14 | 15 | # Asset meta data should only be ignored when the corresponding asset is also ignored 16 | !/[Aa]ssets/**/*.meta 17 | 18 | # Uncomment this line if you wish to ignore the asset store tools plugin 19 | # /[Aa]ssets/AssetStoreTools* 20 | 21 | # Autogenerated Jetbrains Rider plugin 22 | [Aa]ssets/Plugins/Editor/JetBrains* 23 | 24 | # Visual Studio cache directory 25 | .vs/ 26 | .idea/ 27 | 28 | # Gradle cache directory 29 | .gradle/ 30 | 31 | # Autogenerated VS/MD/Consulo solution and project files 32 | ExportedObj/ 33 | .consulo/ 34 | *.csproj 35 | *.unityproj 36 | *.sln 37 | *.suo 38 | *.tmp 39 | *.user 40 | *.userprefs 41 | *.pidb 42 | *.booproj 43 | *.svd 44 | *.pdb 45 | *.mdb 46 | *.opendb 47 | *.VC.db 48 | 49 | # Unity3D generated meta files 50 | *.pidb.meta 51 | *.pdb.meta 52 | *.mdb.meta 53 | 54 | # Unity3D generated file on crash reports 55 | sysinfo.txt 56 | 57 | # Builds 58 | *.apk 59 | *.unitypackage 60 | 61 | # Crashlytics generated file 62 | crashlytics-build.properties 63 | -------------------------------------------------------------------------------- /AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | [assembly:InternalsVisibleTo("com.chwar.xrui.Tests")] 3 | [assembly:InternalsVisibleTo("com.chwar.xrui.Tests.Editor")] -------------------------------------------------------------------------------- /AssemblyInfo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0adcb59eb97e49489335fed321d03683 3 | timeCreated: 1628161217 -------------------------------------------------------------------------------- /Demo.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6461b5e1053f8639abe84728dce7ab2c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Demo/MyModalContent.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2021 Chris Warin 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 5 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6 | using com.chwar.xrui.UIElements; 7 | using UnityEngine; 8 | using UnityEngine.UIElements; 9 | 10 | namespace com.chwar.xrui 11 | { 12 | public class MyModalContent : MonoBehaviour 13 | { 14 | private XRUIModal _xruiModal; 15 | 16 | void Start() 17 | { 18 | _xruiModal = GetComponent(); 19 | StartPage(); 20 | } 21 | 22 | private void StartPage() 23 | { 24 | _xruiModal.UpdateModalFlow("TestUIElement", "xrui-modal__container", () => 25 | { 26 | _xruiModal.SetCancelButtonAction(() => Destroy(_xruiModal.gameObject)); 27 | _xruiModal.SetValidateButtonAction(Validate); 28 | }); 29 | } 30 | 31 | private void Validate() 32 | { 33 | var field = _xruiModal.RootElement.Q(null, "unity-text-field"); 34 | _xruiModal.SetFieldError(field); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Demo/MyModalContent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9eed005f2fc846bb81a18a5c0a4c80a0 3 | timeCreated: 1636718933 -------------------------------------------------------------------------------- /Demo/XRUIDemo.cs: -------------------------------------------------------------------------------- 1 | // MIT License 2 | // Copyright (c) 2021 Chris Warin 3 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 5 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 6 | using System; 7 | using System.Collections; 8 | using com.chwar.xrui.UIElements; 9 | using UnityEngine; 10 | using UnityEngine.UIElements; 11 | 12 | namespace com.chwar.xrui 13 | { 14 | public class XRUIDemo : MonoBehaviour 15 | { 16 | private XRUIMenu _menu; 17 | private XRUICard _card; 18 | private XRUIList _list; 19 | 20 | IEnumerator Start() 21 | { 22 | /* Find XRUI Elements in the scene */ 23 | _menu = FindObjectOfType(); 24 | _card = FindObjectsOfType()[1]; 25 | _list = FindObjectOfType(); 26 | 27 | /* ========== XRUI Menu ========== */ 28 | 29 | // Find the default menu template's main button and add a callback 30 | var mainBtn = _menu.GetXRUIVisualElement