├── ProjectSettings ├── boot.config ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── EditorBuildSettings.asset ├── XRSettings.asset ├── VersionControlSettings.asset ├── TimeManager.asset ├── VFXManager.asset ├── AudioManager.asset ├── TagManager.asset ├── UnityConnectSettings.asset ├── EditorSettings.asset ├── PackageManagerSettings.asset ├── DynamicsManager.asset ├── MemorySettings.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── SceneTemplateSettings.json ├── InputManager.asset └── QualitySettings.asset ├── Documentation ├── menu-picture1.png ├── menu-picture2.png ├── menu-picture3.png ├── menu-picture1.png.meta ├── menu-picture2.png.meta └── menu-picture3.png.meta ├── Assets ├── XiDebugMenu │ ├── Fonts │ │ ├── Read Me.txt │ │ ├── Envy Code R_0.ttf │ │ ├── Envy Code R Bold_0.ttf │ │ ├── Envy Code R Italic_0.ttf │ │ ├── CP866.txt.meta │ │ ├── Read Me.txt.meta │ │ ├── Envy Code R_0 SDF.asset.meta │ │ ├── Envy Code R Bold_0 SDF.asset.meta │ │ ├── Envy Code R Italic_0 SDF.asset.meta │ │ ├── CP866.txt │ │ ├── Envy Code R Italic_0.ttf.meta │ │ ├── Envy Code R Bold_0.ttf.meta │ │ └── Envy Code R_0.ttf.meta │ ├── LICENSE.meta │ ├── CHANGELOG.md.meta │ ├── README.md.meta │ ├── package.json.meta │ ├── Fonts.meta │ ├── Prefabs │ │ └── debug-menu.prefab.meta │ ├── Editor.meta │ ├── Examples.meta │ ├── Examples │ │ ├── debug-menu-demo.unity.meta │ │ ├── DebugMenuDemoC.cs.meta │ │ ├── DebugMenuDemoC.cs │ │ └── debug-menu-demo.unity │ ├── Prefabs.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── XiDebugMenu.asmdef.meta │ │ ├── Colors.cs.meta │ │ ├── DebugMenu.cs.meta │ │ ├── DebugMenuEnum.cs.meta │ │ ├── DebugMenuFloat.cs.meta │ │ ├── DebugMenuItem.cs.meta │ │ ├── DebugMenuTools.cs.meta │ │ ├── DebugMenuAction.cs.meta │ │ ├── DebugMenuController.cs.meta │ │ ├── DebugMenuInteger.cs.meta │ │ ├── DebugMenuString.cs.meta │ │ ├── DebugMenuSystem.cs.meta │ │ ├── DebugMenuToggle.cs.meta │ │ ├── MenuTextRenderer.cs.meta │ │ ├── AlertBoxRepresentation.cs.meta │ │ ├── DebugMenuRepresentation.cs.meta │ │ ├── XiDebugMenu.asmdef │ │ ├── DebugMenuTools.cs │ │ ├── Colors.cs │ │ ├── DebugMenuString.cs │ │ ├── DebugMenuToggle.cs │ │ ├── DebugMenuRepresentation.cs │ │ ├── AlertBoxRepresentation.cs │ │ ├── DebugMenuEnum.cs │ │ ├── DebugMenuController.cs │ │ ├── DebugMenuAction.cs │ │ ├── DebugMenuInteger.cs │ │ ├── DebugMenuItem.cs │ │ ├── DebugMenuSystem.cs │ │ ├── DebugMenuFloat.cs │ │ ├── MenuTextRenderer.cs │ │ └── DebugMenu.cs │ ├── Editor │ │ ├── DebugMenuTreeView.cs.meta │ │ ├── DebugMenuTreeViewWindow.cs.meta │ │ ├── DebugMenuTreeViewWindow.cs │ │ └── DebugMenuTreeView.cs │ ├── package.json │ ├── LICENSE │ ├── CHANGELOG.md │ └── README.md └── XiDebugMenu.meta ├── .releaserc.json ├── .gitignore ├── LICENSE ├── release.config.js ├── .github └── workflows │ └── ci.yml ├── Packages ├── manifest.json └── packages-lock.json ├── CHANGELOG.md └── README.md /ProjectSettings/boot.config: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Documentation/menu-picture1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/XiDebugMenu/HEAD/Documentation/menu-picture1.png -------------------------------------------------------------------------------- /Documentation/menu-picture2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/XiDebugMenu/HEAD/Documentation/menu-picture2.png -------------------------------------------------------------------------------- /Documentation/menu-picture3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/XiDebugMenu/HEAD/Documentation/menu-picture3.png -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Read Me.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/XiDebugMenu/HEAD/Assets/XiDebugMenu/Fonts/Read Me.txt -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2021.3.10f1 2 | m_EditorVersionWithRevision: 2021.3.10f1 (1c7d0df0160b) 3 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/XiDebugMenu/HEAD/Assets/XiDebugMenu/Fonts/Envy Code R_0.ttf -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R Bold_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/XiDebugMenu/HEAD/Assets/XiDebugMenu/Fonts/Envy Code R Bold_0.ttf -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R Italic_0.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hww/XiDebugMenu/HEAD/Assets/XiDebugMenu/Fonts/Envy Code R Italic_0.ttf -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_DefaultPresets: {} 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adb2e522a8a6e0d4eaca0b88f4394cf8 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3aef447adbe3d04449d92cd6f91acb14 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d06fc8860a0a4984e838e40af2c08eff 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e413b0e16df519643acdc36a9005f00f 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 910c67a440bbc60479055dad9f284a60 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/CP866.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7470c01fde009c34fb8b9bc1d59f6e99 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Read Me.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 150e360d738874f49bc873577adfdfee 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a02f7db51a4fe384789fd77830ecd4ad 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Prefabs/debug-menu.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfcfc9d11484de24db00821f6b04d192 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2539df3f355694e4490110a8c2596c95 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dc4521c3f8d97046b15cc3e45098e18 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Examples/debug-menu-demo.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6400ab47ae3703c41a8d19b144f7e121 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d4c029cf4ffa1049804831cca835b9a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 698d65be0386fb843bfbdf4555c850ae 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/XiDebugMenu.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88c97006be8dfab44b07962fc790b59c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R_0 SDF.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6d68f0bc23885c42b05b0e29152acc5 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/VersionControlSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!890905787 &1 4 | VersionControlSettings: 5 | m_ObjectHideFlags: 0 6 | m_Mode: Visible Meta Files 7 | m_CollabEditorSettings: 8 | inProgressEnabled: 1 9 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R Bold_0 SDF.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24da12c660528994f92266e36571602b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R Italic_0 SDF.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 835cc27495d032e4086e61689494ff5b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/Colors.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42eeeb32108025148b7541947d552c01 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c9f3573649d7844d84f0da2fc8f40b7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuEnum.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5e53bb97f0593841b8a6746bd2141c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuFloat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 586c098872f662a4c8b07ae3fce50bf5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuItem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a275031923245f04cbf468c0d25f8d21 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuTools.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc87b341012ddd545a23e34ab97ee771 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Editor/DebugMenuTreeView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d2b7eb637b3f0b45baec586067960c1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Examples/DebugMenuDemoC.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35f1b75eed743774990349b4d51b1410 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuAction.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ec340ede3bdfa8f43b8757177094b96e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d66439f59dcffc4b9d51e731c3672e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuInteger.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8bf9a548bf2d9d48af672969e92c3bb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuString.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4202f6f5e323e1a448d9285472fdd9a9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4f3b0fe949fab64588afbf5805d6e3b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuToggle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d24bfcbe5be03a4d8bdd5b0918d1f71 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/MenuTextRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a4af343809dac348992dea9b50ad55e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Editor/DebugMenuTreeViewWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05b2a8b22b4a2d24cbb12ad72d793378 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/AlertBoxRepresentation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17846e08afe4c5d44b7fd2ac16f7b801 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuRepresentation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2095a4c18e6e6bd48aefaf89aff656e1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_StripUpdateShader: {fileID: 0} 10 | m_RenderPipeSettingsPath: 11 | m_FixedTimeStep: 0.016666668 12 | m_MaxDeltaTime: 0.05 13 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/CP866.txt: -------------------------------------------------------------------------------- 1 | ☺☻♥♦♣♠•◘○◙♂♀♪♫☼ 2 | ►◄↕‼¶§▬↨↑↓→←∟↔▲▼ 3 | !"#$%&'()*+,-./ 4 | 0123456789:;<=>? 5 | @ABCDEFGHIJKLMNO 6 | PQRSTUVWXYZ[\]^_ 7 | `abcdefghijklmno 8 | pqrstuvwxyz{|}~⌂ 9 | ⌂АБВГДЕЖЗИЙКЛМНОП 10 | РСТУФХЦЧШЩЪЫЬЭЮЯ 11 | абвгдежзийклмноп 12 | ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐ 13 | └┴┬├─┼╞╟╚╔╩╦╠═╬╧ 14 | ╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ 15 | рстуфхцчшщъыьэюя 16 | ЁёЄєЇїЎў°∙·√№¤■ 17 |  <-Character 0xA0 18 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R Italic_0.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6ce448ffc858684fbdf006491f1993f 3 | TrueTypeFontImporter: 4 | externalObjects: {} 5 | serializedVersion: 4 6 | fontSize: 16 7 | forceTextureCase: -2 8 | characterSpacing: 0 9 | characterPadding: 1 10 | includeFontData: 1 11 | fontNames: 12 | - Envy Code R 13 | fallbackFontReferences: [] 14 | customCharacters: 15 | fontRenderingMode: 0 16 | ascentCalculationMode: 1 17 | useLegacyBoundsCalculation: 0 18 | shouldRoundAdvanceValue: 1 19 | userData: 20 | assetBundleName: 21 | assetBundleVariant: 22 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/XiDebugMenu.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "XiDebugMenu", 3 | "rootNamespace": "XiDebugMenu", 4 | "references": [ 5 | "UnityEditor.UI", 6 | "Unity.TextMeshPro", 7 | "XiCore", 8 | "NaughtyAttributes.Editor", 9 | "NaughtyAttributes.Core" 10 | ], 11 | "includePlatforms": [], 12 | "excludePlatforms": [], 13 | "allowUnsafeCode": false, 14 | "overrideReferences": false, 15 | "precompiledReferences": [], 16 | "autoReferenced": true, 17 | "defineConstraints": [], 18 | "versionDefines": [], 19 | "noEngineReferences": false 20 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.hww.xidebugmenu", 3 | "displayName": "XiDebugMenu", 4 | "version": "1.0.8", 5 | "unity": "2021.1", 6 | "description": "XiDebugMenu is a debug menu for Unity.", 7 | "license": "MIT", 8 | "author": "hww (https://github.com/hww)", 9 | "keywords": [ 10 | "debug", 11 | "menu" 12 | ], 13 | "dependencies": { 14 | "com.hww.xicore": "https://github.com/hww/XiCore.git#upm", 15 | 16 | }, 17 | "category": "Debug", 18 | "samples": [], 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/hww/XiDebugMenu.git#upm" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R Bold_0.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c5abf8593b47c448ab3bf9c8b423f4e 3 | TrueTypeFontImporter: 4 | externalObjects: {} 5 | serializedVersion: 4 6 | fontSize: 16 7 | forceTextureCase: -2 8 | characterSpacing: 0 9 | characterPadding: 1 10 | includeFontData: 1 11 | fontNames: 12 | - Envy Code R 13 | fallbackFontReferences: 14 | - {fileID: 12800000, guid: e6ce448ffc858684fbdf006491f1993f, type: 3} 15 | customCharacters: 16 | fontRenderingMode: 0 17 | ascentCalculationMode: 1 18 | useLegacyBoundsCalculation: 0 19 | shouldRoundAdvanceValue: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Fonts/Envy Code R_0.ttf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d71e236b2fa47d4e9783b509e9b5f8f 3 | TrueTypeFontImporter: 4 | externalObjects: {} 5 | serializedVersion: 4 6 | fontSize: 16 7 | forceTextureCase: -2 8 | characterSpacing: 0 9 | characterPadding: 1 10 | includeFontData: 1 11 | fontNames: 12 | - Envy Code R 13 | fallbackFontReferences: 14 | - {fileID: 12800000, guid: 8c5abf8593b47c448ab3bf9c8b423f4e, type: 3} 15 | - {fileID: 12800000, guid: e6ce448ffc858684fbdf006491f1993f, type: 3} 16 | customCharacters: 17 | fontRenderingMode: 0 18 | ascentCalculationMode: 1 19 | useLegacyBoundsCalculation: 0 20 | shouldRoundAdvanceValue: 1 21 | userData: 22 | assetBundleName: 23 | assetBundleVariant: 24 | -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "tagFormat": "v${version}", 3 | "plugins": [ 4 | ["@semantic-release/commit-analyzer", { "preset": "angular" }], 5 | "@semantic-release/release-notes-generator", 6 | ["@semantic-release/changelog", { "preset": "angular" }], 7 | ["@semantic-release/npm", { "npmPublish": false, "pkgRoot": "Assets/XiDebugMenu" }], 8 | ["@semantic-release/git", { 9 | "assets": ["Assets/XiDebugMenu/package.json", "CHANGELOG.md"], 10 | "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" 11 | }], 12 | ["@semantic-release/github", { 13 | "assets": [ 14 | {"path": "XiDebugMenu.unitypackage", "label": "XiDebugMenu v${nextRelease.version}"} 15 | ] 16 | }] 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # extDebug .gitignore file 2021 2 | 3 | # ------- 4 | # FOLDERS 5 | # ------- 6 | 7 | # Unity 8 | 9 | /[Ll]ibrary/ 10 | /[Tt]emp/ 11 | /[Oo]bj/ 12 | /[Bb]uild/ 13 | /[Bb]uilds/ 14 | /[Ll]ogs/ 15 | /[Uu]serSettings/ 16 | /Assets/AssetStoreTools* 17 | AssetBundles/ 18 | 19 | # TextMeshPro Essentials 20 | Assets/TextMesh Pro.meta 21 | Assets/TextMesh Pro/ 22 | 23 | # Visual Studio 24 | 25 | ExportedObj/ 26 | 27 | # ----- 28 | # FILES 29 | # ----- 30 | 31 | # Unity 32 | 33 | Assembly-CSharp-Editor-vs.csproj 34 | Assembly-CSharp-Editor.csproj 35 | Assembly-CSharp-firstpass-vs.csproj 36 | Assembly-CSharp-firstpass.csproj 37 | Assembly-CSharp-vs.csproj 38 | Assembly-CSharp.csproj 39 | 40 | # Visual Studio / MonoDevelop 41 | 42 | *.sln 43 | *.svd 44 | *.userprefs 45 | *.pidb 46 | *.suo 47 | *.user 48 | *.unityproj 49 | *.booproj 50 | *.csproj 51 | .vscode/ 52 | .vs/ 53 | .idea/ 54 | .vsconfig 55 | 56 | # OS generated 57 | 58 | .DS_Store 59 | .DS_Store? 60 | ._* 61 | .Spotlight-V100 62 | .Trashes 63 | Icon? 64 | ehthumbs.db 65 | Thumbs.db 66 | Thumbs.db.meta -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_DashboardUrl: https://dashboard.unity3d.com 13 | m_TestInitMode: 0 14 | CrashReportingSettings: 15 | m_EventUrl: https://perf-events.cloud.unity3d.com 16 | m_Enabled: 0 17 | m_LogBufferSize: 10 18 | m_CaptureEditorExceptions: 1 19 | UnityPurchasingSettings: 20 | m_Enabled: 0 21 | m_TestMode: 0 22 | UnityAnalyticsSettings: 23 | m_Enabled: 0 24 | m_TestMode: 0 25 | m_InitializeOnStartup: 1 26 | UnityAdsSettings: 27 | m_Enabled: 0 28 | m_InitializeOnStartup: 1 29 | m_TestMode: 0 30 | m_IosGameId: 31 | m_AndroidGameId: 32 | m_GameIds: {} 33 | m_GameId: 34 | PerformanceReportingSettings: 35 | m_Enabled: 0 36 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 0 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp;asmref 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | m_EnterPlayModeOptionsEnabled: 0 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 0 30 | m_SerializeInlineMappingsOnOneLine: 1 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Valery 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Valery 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.3](https://github.com/hww/XiDebugMenu/compare/v1.0.2...v1.0.3) (2022-09-19) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * **config:** Config fixed ([37775db](https://github.com/hww/XiDebugMenu/commit/37775dbb70819764cbce63f1986f4d459f6f846b)) 7 | * **config:** Config fixed ([3e59b5b](https://github.com/hww/XiDebugMenu/commit/3e59b5bbeb9d9281fe6607e2e913651b0f232c8b)) 8 | 9 | ## [1.0.2](https://github.com/hww/XiDebugMenu/compare/v1.0.1...v1.0.2) (2022-09-19) 10 | 11 | 12 | ### Bug Fixes 13 | 14 | * **CI:** update CI config ([f969a8a](https://github.com/hww/XiDebugMenu/commit/f969a8af08f81a4360bbd3c111541e4269607f6f)) 15 | 16 | ## [1.0.1](https://github.com/hww/XiDebugMenu/compare/v1.0.0...v1.0.1) (2021-10-08) 17 | 18 | 19 | ### Bug Fixes 20 | 21 | * **XiDebugMenu:** check auto build ([40cc118](https://github.com/hww/XiDebugMenu/commit/40cc1189784adffe505c5fc3992b1dfbe8c40df2)) 22 | 23 | # 1.0.0 (2021-10-07) 24 | 25 | 26 | ### Bug Fixes 27 | 28 | * **XiDebugMenu:** fix ([3c129cb](https://github.com/hww/XiDebugMenu/commit/3c129cb42a2b75d95fad5b245b63855f79b631e2)) 29 | * **XiDebugMenu:** fix ([3dc2f7d](https://github.com/hww/XiDebugMenu/commit/3dc2f7db58bbcf99d172649b9fa6bacbff2c1e12)) 30 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_EnablePreReleasePackages: 0 16 | m_EnablePackageDependencies: 0 17 | m_AdvancedSettingsExpanded: 1 18 | m_ScopedRegistriesSettingsExpanded: 1 19 | m_SeeAllPackageVersions: 0 20 | oneTimeWarningShown: 0 21 | m_Registries: 22 | - m_Id: main 23 | m_Name: 24 | m_Url: https://packages.unity.com 25 | m_Scopes: [] 26 | m_IsDefault: 1 27 | m_Capabilities: 7 28 | m_UserSelectedRegistryName: 29 | m_UserAddingNewScopedRegistry: 0 30 | m_RegistryInfoDraft: 31 | m_ErrorMessage: 32 | m_Original: 33 | m_Id: 34 | m_Name: 35 | m_Url: 36 | m_Scopes: [] 37 | m_IsDefault: 0 38 | m_Capabilities: 0 39 | m_Modified: 0 40 | m_Name: 41 | m_Url: 42 | m_Scopes: 43 | - 44 | m_SelectedScopeIndex: 0 45 | m_LoadAssets: 0 46 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /ProjectSettings/MemorySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!387306366 &1 4 | MemorySettings: 5 | m_ObjectHideFlags: 0 6 | m_EditorMemorySettings: 7 | m_MainAllocatorBlockSize: -1 8 | m_ThreadAllocatorBlockSize: -1 9 | m_MainGfxBlockSize: -1 10 | m_ThreadGfxBlockSize: -1 11 | m_CacheBlockSize: -1 12 | m_TypetreeBlockSize: -1 13 | m_ProfilerBlockSize: -1 14 | m_ProfilerEditorBlockSize: -1 15 | m_BucketAllocatorGranularity: -1 16 | m_BucketAllocatorBucketsCount: -1 17 | m_BucketAllocatorBlockSize: -1 18 | m_BucketAllocatorBlockCount: -1 19 | m_ProfilerBucketAllocatorGranularity: -1 20 | m_ProfilerBucketAllocatorBucketsCount: -1 21 | m_ProfilerBucketAllocatorBlockSize: -1 22 | m_ProfilerBucketAllocatorBlockCount: -1 23 | m_TempAllocatorSizeMain: -1 24 | m_JobTempAllocatorBlockSize: -1 25 | m_BackgroundJobTempAllocatorBlockSize: -1 26 | m_JobTempAllocatorReducedBlockSize: -1 27 | m_TempAllocatorSizeGIBakingWorker: -1 28 | m_TempAllocatorSizeNavMeshWorker: -1 29 | m_TempAllocatorSizeAudioWorker: -1 30 | m_TempAllocatorSizeCloudWorker: -1 31 | m_TempAllocatorSizeGfx: -1 32 | m_TempAllocatorSizeJobWorker: -1 33 | m_TempAllocatorSizeBackgroundWorker: -1 34 | m_TempAllocatorSizePreloadManager: -1 35 | m_PlatformMemorySettings: {} 36 | -------------------------------------------------------------------------------- /release.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "branches" : "master", 3 | "tagFormat": "v${version}", 4 | "plugins": [ 5 | ["@semantic-release/commit-analyzer", { 6 | "preset": "angular", 7 | "releaseRules" : [ 8 | {"type": "docs", "release": "patch"}, 9 | {"type": "docs", "scope": "README", "release": false} 10 | ] 11 | }], 12 | ["@semantic-release/release-notes-generator", { 13 | "writerOpts": { 14 | "commitsSort": ["scope", "subject"] 15 | } 16 | }], 17 | ["@semantic-release/changelog", { 18 | "changelogFile": "CHANGELOG.md" 19 | }], 20 | ["@semantic-release/npm", { 21 | "npmPublish": false, 22 | "pkgRoot": `Assets/${process.env.PROJECT_NAME}` }], 23 | ["@semantic-release/git", { 24 | "assets": [`Assets/${process.env.PROJECT_NAME}/package.json`, "CHANGELOG.md"], 25 | "message": "chore(release): new release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" 26 | }], 27 | ["@iam1337/create-unitypackage", { 28 | "packageRoot": `Assets/${process.env.PROJECT_NAME}`, 29 | "projectRoot": "./", 30 | "output": `${process.env.PROJECT_NAME}.unitypackage` 31 | }], 32 | ["@semantic-release/github", { 33 | "assets": [ 34 | {"path": `${process.env.PROJECT_NAME}.unitypackage`, "label": `${process.env.PROJECT_NAME} v\${nextRelease.version}`} 35 | ] 36 | }] 37 | ], 38 | "preset": "angular" 39 | } 40 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: ⚙ Build and Release 2 | on: 3 | push: 4 | branches: 5 | - master 6 | 7 | jobs: 8 | release: 9 | name: ⚙ Release 10 | runs-on: ubuntu-latest 11 | env: 12 | PROJECT_NAME: XiDebugMenu 13 | PROJECT_ASSETS: README.md:CHANGELOG.md:LICENSE 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Semantic Release 17 | id: semantic 18 | uses: cycjimmy/semantic-release-action@v2 19 | env: 20 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 21 | with: 22 | branch: master 23 | extra_plugins: | 24 | @semantic-release/changelog 25 | @semantic-release/git 26 | 27 | - name: Push UPM update 28 | run: | 29 | IFS=: read -r -a PROJECT_ASSETS_ARRAY <<< "$PROJECT_ASSETS" 30 | mkdir Temp 31 | for asset in "${PROJECT_ASSETS_ARRAY[@]}"; do 32 | cp ${asset} Temp/${asset} 33 | done 34 | git log -1 35 | git subtree split -P "Assets/$PROJECT_NAME" -b upm 36 | git checkout upm 37 | for asset in "${PROJECT_ASSETS_ARRAY[@]}"; do 38 | cp Temp/${asset} ${asset} 39 | git add ${asset} 40 | done 41 | if [[ -d "Examples" ]]; then 42 | git mv Examples Examples~ 43 | rm -f Examples.meta 44 | fi 45 | git config user.name github-actions 46 | git config user.email github-actions@github.com 47 | git commit -am "chore(release): update upm branch [skip ci]" 48 | git push -f -u origin upm 49 | - name: Push UPM tag 50 | if: steps.semantic.outputs.new_release_published == 'true' 51 | env: 52 | UPM_TAG: upm/v${{ steps.semantic.outputs.new_release_version }} 53 | run: | 54 | git tag $UPM_TAG upm 55 | git push origin --tags 56 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | 4 | "com.hww.xicore": "https://github.com/hww/XiCore.git#upm", 5 | "com.unity.collab-proxy": "1.17.2", 6 | "com.unity.ide.rider": "3.0.15", 7 | "com.unity.ide.visualstudio": "2.0.16", 8 | "com.unity.ide.vscode": "1.2.5", 9 | "com.unity.test-framework": "1.1.31", 10 | "com.unity.textmeshpro": "3.0.6", 11 | "com.unity.timeline": "1.6.4", 12 | "com.unity.ugui": "1.0.0", 13 | "com.unity.visualscripting": "1.7.8", 14 | "com.unity.modules.ai": "1.0.0", 15 | "com.unity.modules.androidjni": "1.0.0", 16 | "com.unity.modules.animation": "1.0.0", 17 | "com.unity.modules.assetbundle": "1.0.0", 18 | "com.unity.modules.audio": "1.0.0", 19 | "com.unity.modules.cloth": "1.0.0", 20 | "com.unity.modules.director": "1.0.0", 21 | "com.unity.modules.imageconversion": "1.0.0", 22 | "com.unity.modules.imgui": "1.0.0", 23 | "com.unity.modules.jsonserialize": "1.0.0", 24 | "com.unity.modules.particlesystem": "1.0.0", 25 | "com.unity.modules.physics": "1.0.0", 26 | "com.unity.modules.physics2d": "1.0.0", 27 | "com.unity.modules.screencapture": "1.0.0", 28 | "com.unity.modules.terrain": "1.0.0", 29 | "com.unity.modules.terrainphysics": "1.0.0", 30 | "com.unity.modules.tilemap": "1.0.0", 31 | "com.unity.modules.ui": "1.0.0", 32 | "com.unity.modules.uielements": "1.0.0", 33 | "com.unity.modules.umbra": "1.0.0", 34 | "com.unity.modules.unityanalytics": "1.0.0", 35 | "com.unity.modules.unitywebrequest": "1.0.0", 36 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 37 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 38 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 39 | "com.unity.modules.unitywebrequestwww": "1.0.0", 40 | "com.unity.modules.vehicles": "1.0.0", 41 | "com.unity.modules.video": "1.0.0", 42 | "com.unity.modules.vr": "1.0.0", 43 | "com.unity.modules.wind": "1.0.0", 44 | "com.unity.modules.xr": "1.0.0" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuTools.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | namespace XiDebugMenu 26 | { 27 | public class DebugMenuTools 28 | { 29 | public static string GetFileName(string path) 30 | { 31 | var idx = path.LastIndexOf("/"); 32 | if (idx < 0) 33 | return path; 34 | return path.Substring(idx + 1); 35 | } 36 | 37 | public static string GetDirectoryName(string path) 38 | { 39 | var idx = path.LastIndexOf("/"); 40 | if (idx < 0) 41 | return string.Empty; 42 | return path.Substring(0, idx); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/Colors.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | namespace XiDebugMenu 26 | { 27 | public static class Colors 28 | { 29 | public const string ValueDefault = "#C9E3DB"; //bfffbf 30 | public const string ValueModified = "#ffff00"; 31 | public const string LabelDefault = "#eeeeee"; 32 | public const string LabelModified = "#ffff00"; 33 | public const string ToggleLabelDisabled = "#eeeeee"; 34 | public const string ToggleLabelEnabled = "#ffff01"; 35 | public const string ActionLabelDisabled = "#707070"; 36 | public const string ActionLabelEnabled = "#eeeeee"; 37 | public const string ActionLabelActivated = "#5AB190"; 38 | } 39 | } -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.0.8](https://github.com/hww/XiDebugMenu/compare/v1.0.7...v1.0.8) (2022-10-09) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * **code:** Minor changes ([696ba20](https://github.com/hww/XiDebugMenu/commit/696ba20412016f8a671584a8afee7a261e9ed8b0)) 7 | 8 | ## [1.0.7](https://github.com/hww/XiDebugMenu/compare/v1.0.6...v1.0.7) (2022-10-09) 9 | 10 | 11 | ### Bug Fixes 12 | 13 | * **code:** Minor changes ([21bf0ca](https://github.com/hww/XiDebugMenu/commit/21bf0ca2af2325a5d780555ae5c8a04a8d59e194)) 14 | 15 | ## [1.0.6](https://github.com/hww/XiDebugMenu/compare/v1.0.5...v1.0.6) (2022-10-09) 16 | 17 | 18 | ### Bug Fixes 19 | 20 | * **code:** Minor changes ([6d65cfc](https://github.com/hww/XiDebugMenu/commit/6d65cfc7e083d2cb8f5a3d67e161517a0ae43414)) 21 | 22 | ## [1.0.5](https://github.com/hww/XiDebugMenu/compare/v1.0.4...v1.0.5) (2022-09-20) 23 | 24 | 25 | ### Bug Fixes 26 | 27 | * **font:** Fixed font width ([f21924d](https://github.com/hww/XiDebugMenu/commit/f21924d9d5b8fc791ca33aba3a9dcae384e4bc47)) 28 | 29 | ## [1.0.4](https://github.com/hww/XiDebugMenu/compare/v1.0.3...v1.0.4) (2022-09-20) 30 | 31 | 32 | ### Bug Fixes 33 | 34 | * **files:** Added meta files ([2f44db2](https://github.com/hww/XiDebugMenu/commit/2f44db2822c8fe141803a357073e073ed63914f1)) 35 | 36 | ## [1.0.3](https://github.com/hww/XiDebugMenu/compare/v1.0.2...v1.0.3) (2022-09-19) 37 | 38 | 39 | ### Bug Fixes 40 | 41 | * **config:** Config fixed ([37775db](https://github.com/hww/XiDebugMenu/commit/37775dbb70819764cbce63f1986f4d459f6f846b)) 42 | * **config:** Config fixed ([3e59b5b](https://github.com/hww/XiDebugMenu/commit/3e59b5bbeb9d9281fe6607e2e913651b0f232c8b)) 43 | 44 | ## [1.0.2](https://github.com/hww/XiDebugMenu/compare/v1.0.1...v1.0.2) (2022-09-19) 45 | 46 | 47 | ### Bug Fixes 48 | 49 | * **CI:** update CI config ([f969a8a](https://github.com/hww/XiDebugMenu/commit/f969a8af08f81a4360bbd3c111541e4269607f6f)) 50 | 51 | ## [1.0.1](https://github.com/hww/XiDebugMenu/compare/v1.0.0...v1.0.1) (2021-10-08) 52 | 53 | 54 | ### Bug Fixes 55 | 56 | * **XiDebugMenu:** check auto build ([40cc118](https://github.com/hww/XiDebugMenu/commit/40cc1189784adffe505c5fc3992b1dfbe8c40df2)) 57 | 58 | # 1.0.0 (2021-10-07) 59 | 60 | 61 | ### Bug Fixes 62 | 63 | * **XiDebugMenu:** fix ([3c129cb](https://github.com/hww/XiDebugMenu/commit/3c129cb42a2b75d95fad5b245b63855f79b631e2)) 64 | * **XiDebugMenu:** fix ([3dc2f7d](https://github.com/hww/XiDebugMenu/commit/3dc2f7db58bbcf99d172649b9fa6bacbff2c1e12)) 65 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 13 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | m_LogWhenShaderIsCompiled: 0 63 | m_AllowEnlightenSupportForUpgradedProject: 0 64 | -------------------------------------------------------------------------------- /Documentation/menu-picture1.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab237e69c5ca4eb4c8cdd3e168c4610c 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 0 39 | wrapV: 0 40 | wrapW: 0 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | spriteSheet: 79 | serializedVersion: 2 80 | sprites: [] 81 | outline: [] 82 | physicsShape: [] 83 | bones: [] 84 | spriteID: 85 | internalID: 0 86 | vertices: [] 87 | indices: 88 | edges: [] 89 | weights: [] 90 | secondaryTextures: [] 91 | spritePackingTag: 92 | pSDRemoveMatte: 0 93 | pSDShowRemoveMatteOption: 0 94 | userData: 95 | assetBundleName: 96 | assetBundleVariant: 97 | -------------------------------------------------------------------------------- /Documentation/menu-picture2.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb2c08895315ca24bb7e69e780903295 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 0 39 | wrapV: 0 40 | wrapW: 0 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | spriteSheet: 79 | serializedVersion: 2 80 | sprites: [] 81 | outline: [] 82 | physicsShape: [] 83 | bones: [] 84 | spriteID: 85 | internalID: 0 86 | vertices: [] 87 | indices: 88 | edges: [] 89 | weights: [] 90 | secondaryTextures: [] 91 | spritePackingTag: 92 | pSDRemoveMatte: 0 93 | pSDShowRemoveMatteOption: 0 94 | userData: 95 | assetBundleName: 96 | assetBundleVariant: 97 | -------------------------------------------------------------------------------- /Documentation/menu-picture3.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31de1e9e96e4dd84fb23632044bb3568 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | vTOnly: 0 27 | grayScaleToAlpha: 0 28 | generateCubemap: 6 29 | cubemapConvolution: 0 30 | seamlessCubemap: 0 31 | textureFormat: 1 32 | maxTextureSize: 2048 33 | textureSettings: 34 | serializedVersion: 2 35 | filterMode: 1 36 | aniso: 1 37 | mipBias: 0 38 | wrapU: 0 39 | wrapV: 0 40 | wrapW: 0 41 | nPOTScale: 1 42 | lightmap: 0 43 | compressionQuality: 50 44 | spriteMode: 0 45 | spriteExtrude: 1 46 | spriteMeshType: 1 47 | alignment: 0 48 | spritePivot: {x: 0.5, y: 0.5} 49 | spritePixelsToUnits: 100 50 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 51 | spriteGenerateFallbackPhysicsShape: 1 52 | alphaUsage: 1 53 | alphaIsTransparency: 0 54 | spriteTessellationDetail: -1 55 | textureType: 0 56 | textureShape: 1 57 | singleChannelComponent: 0 58 | flipbookRows: 1 59 | flipbookColumns: 1 60 | maxTextureSizeSet: 0 61 | compressionQualitySet: 0 62 | textureFormatSet: 0 63 | ignorePngGamma: 0 64 | applyGammaDecoding: 0 65 | platformSettings: 66 | - serializedVersion: 3 67 | buildTarget: DefaultTexturePlatform 68 | maxTextureSize: 2048 69 | resizeAlgorithm: 0 70 | textureFormat: -1 71 | textureCompression: 1 72 | compressionQuality: 50 73 | crunchedCompression: 0 74 | allowsAlphaSplitting: 0 75 | overridden: 0 76 | androidETC2FallbackOverride: 0 77 | forceMaximumCompressionQuality_BC6H_BC7: 0 78 | spriteSheet: 79 | serializedVersion: 2 80 | sprites: [] 81 | outline: [] 82 | physicsShape: [] 83 | bones: [] 84 | spriteID: 85 | internalID: 0 86 | vertices: [] 87 | indices: 88 | edges: [] 89 | weights: [] 90 | secondaryTextures: [] 91 | spritePackingTag: 92 | pSDRemoveMatte: 0 93 | pSDShowRemoveMatteOption: 0 94 | userData: 95 | assetBundleName: 96 | assetBundleVariant: 97 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Examples/DebugMenuDemoC.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System.Collections; 26 | using UnityEngine; 27 | using XiDebugMenu; 28 | 29 | 30 | namespace XiDebugMenu.Demo 31 | { 32 | public class DebugMenuDemoC : MonoBehaviour 33 | { 34 | public enum TrafficLight { Red, Green, Blue } 35 | 36 | public TrafficLight enumValue; 37 | public bool toggleValue; 38 | public int integerValue; 39 | public float floatValue; 40 | 41 | private void OnEnable() 42 | { 43 | 44 | new DebugMenu("Edit/Preferences").AutoRefresh(1f); 45 | new DebugMenuToggle("Edit/Preferences/Toggle", () => toggleValue, value => toggleValue = value, 1); 46 | new DebugMenuInteger("Edit/Preferences/Integer", () => integerValue, value => integerValue = value, 2); 47 | new DebugMenuFloat("Edit/Preferences/Float", () => floatValue, value => floatValue = value, 3); 48 | new DebugMenuAction("Edit/Preferences/Action", (item, e) => { Debug.Log("Action"); }, 4); 49 | new DebugMenuEnum("Edit/Preferences/TraficLight", () => enumValue, value => enumValue = value, 1); 50 | new DebugMenuFloat("Edit/Preferences/Time", () => Time.time, order: 20); 51 | new DebugMenu("Edit/Preferences/Extra Preferences", 30) 52 | .OnOpen(menu => 53 | { 54 | new DebugMenuToggle(menu, "Toggle2", () => toggleValue, value => toggleValue = value); 55 | }) 56 | .OnClose(menu => 57 | { 58 | menu.Clear(); 59 | }); 60 | 61 | } 62 | 63 | } 64 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuString.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System; 26 | 27 | namespace XiDebugMenu 28 | { 29 | public class DebugMenutring : DebugMenuItem 30 | { 31 | private readonly Func getter; 32 | private readonly Action setter; 33 | 34 | public DebugMenutring(string path, Func getter, Action setter = null, int order = 0) 35 | : base(path, order) 36 | { 37 | this.getter = getter; 38 | this.setter = setter; 39 | valueColor = Colors.ValueDefault; 40 | labelColor = Colors.LabelDefault; 41 | Render(); 42 | } 43 | 44 | public DebugMenutring(DebugMenu parentMenu, string label, Func getter = null, Action setter = null, int order = 0) 45 | : base(parentMenu, label, order) 46 | { 47 | this.getter = getter; 48 | this.setter = setter; 49 | valueColor = Colors.ValueDefault; 50 | labelColor = Colors.LabelDefault; 51 | Render(); 52 | } 53 | 54 | public override void OnEvent(EvenTag tag) 55 | { 56 | switch (tag) 57 | { 58 | case EvenTag.Render: 59 | Render(); 60 | break; 61 | } 62 | } 63 | 64 | private void Render() 65 | { 66 | if (getter!=null) 67 | value = getter(); 68 | } 69 | 70 | private void OnModified() 71 | { 72 | if (DebugMenuSystem.isVisible) 73 | return; 74 | DebugMenuSystem.FlashText($"{label} {value}"); 75 | } 76 | 77 | } 78 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Editor/DebugMenuTreeViewWindow.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using UnityEngine; 26 | using UnityEditor.IMGUI.Controls; 27 | using UnityEditor; 28 | 29 | namespace XiDebugMenu 30 | { 31 | class DebugMenuTreeViewWindow : EditorWindow 32 | { 33 | // SerializeField is used to ensure the view state is written to the window 34 | // layout file. This means that the state survives restarting Unity as long as the window 35 | // is not closed. If the attribute is omitted then the state is still serialized/deserialized. 36 | [SerializeField] TreeViewState m_TreeViewState; 37 | 38 | //The TreeView is not serializable, so it should be reconstructed from the tree data. 39 | DebugMenuTreeView m_TreeView; 40 | private float m_refreshAt; 41 | 42 | void OnEnable () 43 | { 44 | if (m_TreeViewState == null) 45 | m_TreeViewState = new TreeViewState (); 46 | m_refreshAt = Time.time + 2f; 47 | m_TreeView = new DebugMenuTreeView(m_TreeViewState); 48 | } 49 | 50 | void OnGUI () 51 | { 52 | if (Time.time > m_refreshAt) 53 | { 54 | m_refreshAt = Time.time + 2f; 55 | m_TreeView = new DebugMenuTreeView(m_TreeViewState); 56 | } 57 | m_TreeView?.OnGUI(new Rect(0, 0, position.width, position.height)); 58 | } 59 | 60 | [MenuItem ("/Window/Rocket/Debug Menu Tree Window")] 61 | static void ShowWindow () 62 | { 63 | var window = GetWindow (); 64 | window.titleContent = new GUIContent ("Debug Menu Tree"); 65 | window.Show (); 66 | } 67 | 68 | void OnSelectionChange () 69 | { 70 | m_TreeView?.SetSelection (Selection.instanceIDs); 71 | Repaint (); 72 | } 73 | 74 | void OnHierarchyChange() 75 | { 76 | m_TreeView?.Reload(); 77 | Repaint (); 78 | } 79 | } 80 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Editor/DebugMenuTreeView.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System.Collections.Generic; 26 | using System.Linq; 27 | using UnityEditor; 28 | using UnityEditor.IMGUI.Controls; 29 | 30 | namespace XiDebugMenu 31 | { 32 | class DebugMenuTreeView : TreeView 33 | { 34 | public DebugMenuTreeView(TreeViewState treeViewState) 35 | : base(treeViewState) 36 | { 37 | Reload(); 38 | } 39 | 40 | protected override TreeViewItem BuildRoot () 41 | { 42 | var root = new TreeViewItem { id = 0, depth = -1, displayName = "Scene" }; 43 | var rootDebugMenu = DebugMenuSystem.RootDebugMenu; 44 | var rootDebugTree = BuildTree(rootDebugMenu); 45 | root.AddChild(rootDebugTree); 46 | SetupDepthsFromParentsAndChildren(root); 47 | return root; 48 | } 49 | 50 | 51 | TreeViewItem BuildTree(DebugMenu debugMenu) 52 | { 53 | var bucketTree = new TreeViewItem { id = 0, displayName = $"[{debugMenu.order}] {debugMenu.label}..." }; 54 | for (var i = 0; i < debugMenu.Count; i++) 55 | { 56 | var item = debugMenu[i]; 57 | if (item != null) 58 | { 59 | if (item is DebugMenu) 60 | { 61 | var submenuTree = BuildTree(item as DebugMenu); 62 | bucketTree.AddChild(submenuTree); 63 | } 64 | else 65 | { 66 | var itemTree = new TreeViewItem { id = 0, displayName = $"[{item.order}] '{item.label}'={item.value}" }; 67 | bucketTree.AddChild(itemTree); 68 | } 69 | } 70 | } 71 | return bucketTree; 72 | } 73 | 74 | // Selection 75 | protected override void SelectionChanged (IList selectedIds) 76 | { 77 | Selection.instanceIDs = selectedIds.ToArray(); 78 | } 79 | 80 | } 81 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuToggle.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System; 26 | 27 | namespace XiDebugMenu 28 | { 29 | public class DebugMenuToggle : DebugMenuItem 30 | { 31 | private readonly Func getter; 32 | private readonly Action setter; 33 | private bool defaultValue; 34 | 35 | public DebugMenuToggle(string path, Func getter, Action setter, int order = 0) 36 | : base(path, order) 37 | { 38 | this.getter = getter; 39 | this.setter = setter; 40 | value = null; // do not have value, wil display it by color 41 | defaultValue = this.getter(); 42 | } 43 | 44 | public DebugMenuToggle(DebugMenu parentMenu, string label, Func getter, Action setter, 45 | int order = 0) 46 | : base(parentMenu, label, order) 47 | { 48 | this.getter = getter; 49 | this.setter = setter; 50 | value = null; // do not have value, wil display it by color 51 | defaultValue = this.getter(); 52 | } 53 | 54 | public override void OnEvent(EvenTag tag) 55 | { 56 | switch (tag) 57 | { 58 | case EvenTag.Render: 59 | Render(); 60 | break; 61 | case EvenTag.Right: 62 | setter(!getter()); 63 | Render(); 64 | OnModified(); 65 | break; 66 | case EvenTag.Left: 67 | setter(!getter()); 68 | Render(); 69 | OnModified(); 70 | break; 71 | case EvenTag.Reset: 72 | setter(defaultValue); 73 | Render(); 74 | OnModified(); 75 | break; 76 | } 77 | } 78 | 79 | private void Render() 80 | { 81 | var val = getter(); 82 | labelColor = val ? Colors.ToggleLabelEnabled : Colors.ToggleLabelDisabled; 83 | } 84 | 85 | private void OnModified() 86 | { 87 | if (DebugMenuSystem.isVisible) 88 | return; 89 | DebugMenuSystem.FlashText($"{label}"); 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuRepresentation.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using TMPro; 26 | using UnityEngine; 27 | 28 | namespace XiDebugMenu 29 | { 30 | public class DebugMenuRepresentation : MonoBehaviour 31 | { 32 | [Header("Managed Objects")] 33 | public Canvas canvas; 34 | public TextMeshProUGUI menuText; 35 | public Transform backgroundTransform; 36 | [Header("Settings")] 37 | public int fontSize = 16; 38 | 39 | private float hideTextAt; 40 | 41 | // ============================================================================================================= 42 | // Mono behaviour 43 | // ============================================================================================================= 44 | 45 | public void OnValidate() 46 | { 47 | Debug.Assert(canvas != null); 48 | Debug.Assert(menuText != null); 49 | } 50 | 51 | 52 | private void OnEnable() 53 | { 54 | menuText.fontSize = fontSize; 55 | menuText.autoSizeTextContainer = true; 56 | SetVisible(false); 57 | DebugMenuSystem.Initialize(); 58 | } 59 | 60 | private void OnDisable() 61 | { 62 | DebugMenuSystem.DeInitialize(); 63 | } 64 | 65 | void Update() 66 | { 67 | DebugMenuSystem.Update(); 68 | if (hideTextAt > 0 && Time.unscaledTime > hideTextAt) 69 | { 70 | hideTextAt = -1f; 71 | SetVisible(false); 72 | } 73 | } 74 | 75 | // ============================================================================================================= 76 | // Manipulating by menu 77 | // ============================================================================================================= 78 | 79 | public void SetVisible(bool state) 80 | { 81 | canvas.enabled = state; 82 | } 83 | 84 | public void SetText(string text) 85 | { 86 | menuText.text = text; 87 | hideTextAt = -1; 88 | } 89 | 90 | public void FlashText(string text) 91 | { 92 | menuText.text = text; 93 | hideTextAt = Time.unscaledTime + 1.5f; 94 | SetVisible(true); 95 | } 96 | } 97 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/AlertBoxRepresentation.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using TMPro; 26 | using UnityEngine; 27 | 28 | namespace XiDebugMenu 29 | { 30 | public class AlertBoxRepresentation : MonoBehaviour 31 | { 32 | [Header("Managed Objects")] 33 | public Canvas canvas; 34 | public TextMeshProUGUI mainText; 35 | public Transform backgroundTransform; 36 | [Header("Settings")] 37 | public int fontSize = 16; 38 | public bool testFlashText; 39 | 40 | private float hideTextAt; 41 | 42 | // ============================================================================================================= 43 | // Mono behaviour 44 | // ============================================================================================================= 45 | 46 | public void OnValidate() 47 | { 48 | Debug.Assert(canvas != null); 49 | Debug.Assert(mainText != null); 50 | } 51 | 52 | 53 | private void OnEnable() 54 | { 55 | mainText.fontSize = fontSize; 56 | mainText.autoSizeTextContainer = true; 57 | SetVisible(false); 58 | DebugMenuSystem.Initialize(); 59 | } 60 | 61 | private void OnDisable() 62 | { 63 | DebugMenuSystem.DeInitialize(); 64 | } 65 | 66 | void Update() 67 | { 68 | if (testFlashText) 69 | { 70 | testFlashText = false; 71 | TestFlashText(); 72 | } 73 | DebugMenuSystem.Update(); 74 | if (hideTextAt > 0 && Time.unscaledTime > hideTextAt) 75 | { 76 | hideTextAt = -1f; 77 | SetVisible(false); 78 | } 79 | } 80 | 81 | // ============================================================================================================= 82 | // Manipulating by menu 83 | // ============================================================================================================= 84 | 85 | public void SetVisible(bool state) 86 | { 87 | canvas.enabled = state; 88 | } 89 | 90 | public void SetText(string text) 91 | { 92 | mainText.text = text; 93 | hideTextAt = -1; 94 | } 95 | 96 | public void FlashText(string text) 97 | { 98 | mainText.text = text; 99 | hideTextAt = Time.unscaledTime + 2.0f; 100 | SetVisible(true); 101 | } 102 | 103 | public void TestFlashText() 104 | { 105 | FlashText("Test text"); 106 | } 107 | } 108 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuEnum.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System; 26 | using XiCore.Extensions; 27 | 28 | namespace XiDebugMenu 29 | { 30 | public class DebugMenuEnum : DebugMenuItem where T : struct, Enum 31 | { 32 | private readonly Func getter; 33 | private readonly Action setter; 34 | private T defaultValue; 35 | 36 | public DebugMenuEnum(string path, Func getter, Action setter, int order = 0) 37 | : base(path, order) 38 | { 39 | this.getter = getter; 40 | this.setter = setter; 41 | value = null; // do not have value, wil display it by color 42 | defaultValue = this.getter(); 43 | } 44 | 45 | public DebugMenuEnum(DebugMenu parentMenu, string label, Func getter, Action setter, int order = 0) 46 | : base(parentMenu, label, order) 47 | { 48 | this.getter = getter; 49 | this.setter = setter; 50 | value = null; // do not have value, wil display it by color 51 | defaultValue = this.getter(); 52 | } 53 | 54 | 55 | public override void OnEvent(EvenTag tag) 56 | { 57 | switch (tag) 58 | { 59 | case EvenTag.Render: 60 | Render(); 61 | break; 62 | case EvenTag.Right: 63 | setter?.Invoke(EnumExtensions.Next(getter())); 64 | Render(); 65 | OnModified(); 66 | break; 67 | case EvenTag.Left: 68 | setter?.Invoke(EnumExtensions.Previous(getter())); 69 | Render(); 70 | OnModified(); 71 | break; 72 | case EvenTag.Reset: 73 | setter?.Invoke(defaultValue); 74 | Render(); 75 | OnModified(); 76 | break; 77 | } 78 | } 79 | 80 | private void Render() 81 | { 82 | var val = getter(); 83 | var def = val.Equals(defaultValue); 84 | value = val.ToString(); 85 | valueColor = def ? Colors.ValueDefault : Colors.ValueModified; 86 | labelColor = def ? Colors.LabelDefault : Colors.LabelModified; 87 | } 88 | 89 | private void OnModified() 90 | { 91 | if (DebugMenuSystem.isVisible) 92 | return; 93 | DebugMenuSystem.FlashText($"{label} {value}"); 94 | } 95 | 96 | public DebugMenuEnum Default(T value) 97 | { 98 | defaultValue = value; 99 | return this; 100 | } 101 | } 102 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuController.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System.Runtime.CompilerServices; 26 | using UnityEngine; 27 | 28 | namespace XiDebugMenu 29 | { 30 | public class DebugMenuController 31 | { 32 | private DebugMenuItem.EvenTag lastEvent; 33 | private float repeatTimer; 34 | private const float REPEAT_DELAY = 0.75f; 35 | private const float REPEAT_INTERVAL = 0.1f; 36 | 37 | public DebugMenuItem.EvenTag GetEvet() 38 | { 39 | var evt = GetEvetInternal(); 40 | if (lastEvent != evt) 41 | { 42 | lastEvent = evt; 43 | repeatTimer = REPEAT_DELAY; 44 | return lastEvent; 45 | } 46 | else 47 | { 48 | if (lastEvent == DebugMenuItem.EvenTag.Null) 49 | return DebugMenuItem.EvenTag.Null; 50 | 51 | repeatTimer -= Time.deltaTime; 52 | if (repeatTimer < 0) 53 | { 54 | repeatTimer = REPEAT_INTERVAL; 55 | return lastEvent; 56 | } 57 | return DebugMenuItem.EvenTag.Null; 58 | } 59 | 60 | } 61 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 62 | private DebugMenuItem.EvenTag GetEvetInternal() 63 | { 64 | if (Input.GetKey(KeyCode.E)) 65 | return DebugMenuItem.EvenTag.ToggleMenu; 66 | if (Input.GetKey(KeyCode.F)) 67 | return DebugMenuItem.EvenTag.ToggleQuickMenu; 68 | if (Input.GetKey(KeyCode.Q)) 69 | return DebugMenuItem.EvenTag.CloseMenu; 70 | 71 | if (DebugMenuSystem.isVisible) 72 | { 73 | if (Input.GetKey(KeyCode.W)) 74 | return DebugMenuItem.EvenTag.Up; 75 | if (Input.GetKey(KeyCode.S)) 76 | return DebugMenuItem.EvenTag.Down; 77 | if (Input.GetKey(KeyCode.A)) 78 | return DebugMenuItem.EvenTag.Left; 79 | if (Input.GetKey(KeyCode.D)) 80 | return DebugMenuItem.EvenTag.Right; 81 | if (Input.GetKey(KeyCode.R)) 82 | return DebugMenuItem.EvenTag.Reset; 83 | } 84 | else 85 | { 86 | if (Input.GetKey(KeyCode.LeftShift)) 87 | { 88 | if (Input.GetKey(KeyCode.A)) 89 | return DebugMenuItem.EvenTag.Left; 90 | if (Input.GetKey(KeyCode.D)) 91 | return DebugMenuItem.EvenTag.Right; 92 | if (Input.GetKey(KeyCode.R)) 93 | return DebugMenuItem.EvenTag.Reset; 94 | } 95 | } 96 | return DebugMenuItem.EvenTag.Null; 97 | } 98 | } 99 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuAction.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System; 26 | using UnityEngine; 27 | 28 | namespace XiDebugMenu 29 | { 30 | public class DebugMenuAction : DebugMenuItem 31 | { 32 | private const float ACTION_HIGHLIGHT_TIME = 0.9f; 33 | private const float ACTION_MENU_REFRESH_DELAY = 1.0f; 34 | 35 | private readonly Action action; 36 | private float lastInvokedAt; 37 | 38 | public DebugMenuAction(string path, Action action, int order = 0) 39 | : base(path, order) 40 | { 41 | this.action = action; 42 | value = null; // do not have value, wil display it by color 43 | lastInvokedAt = -9999; 44 | } 45 | 46 | public DebugMenuAction(DebugMenu parentMenu, string label, Action action = null, int order = 0) 47 | : base(parentMenu, label, order) 48 | { 49 | this.action = action; 50 | value = null; // do not have value, wil display it by color 51 | lastInvokedAt = -9999; 52 | } 53 | 54 | 55 | public override void OnEvent(EvenTag tag) 56 | { 57 | switch (tag) 58 | { 59 | case EvenTag.Render: 60 | Render(); 61 | break; 62 | case EvenTag.Left: 63 | if (action != null) 64 | { 65 | action(this, tag); 66 | lastInvokedAt = Time.unscaledTime; 67 | Render(); 68 | OnModified(); 69 | } 70 | break; 71 | case EvenTag.Right: 72 | if (action != null) 73 | { 74 | action(this, tag); 75 | lastInvokedAt = Time.unscaledTime; 76 | Render(); 77 | OnModified(); 78 | } 79 | break; 80 | case EvenTag.Reset: 81 | action(this, tag); 82 | break; 83 | } 84 | } 85 | 86 | private void Render() 87 | { 88 | if (action == null) 89 | { 90 | labelColor = Colors.ActionLabelDisabled ; 91 | } 92 | else 93 | { 94 | var isInvoked = lastInvokedAt + ACTION_HIGHLIGHT_TIME > Time.unscaledTime; 95 | labelColor = isInvoked ? Colors.ActionLabelActivated : Colors.ActionLabelEnabled ; 96 | 97 | } 98 | } 99 | 100 | private void OnModified() 101 | { 102 | if (DebugMenuSystem.isVisible) 103 | parentMenu.RequestRefresh(ACTION_MENU_REFRESH_DELAY); 104 | else 105 | DebugMenuSystem.FlashText($"{label} {value}"); 106 | } 107 | } 108 | 109 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuInteger.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System; 26 | 27 | namespace XiDebugMenu 28 | { 29 | public class DebugMenuInteger : DebugMenuItem 30 | { 31 | private const string DEFAULT_FORMAT = "{0}"; 32 | private readonly Func getter; 33 | private readonly Action setter; 34 | private string format; 35 | private int step; 36 | private int defaultValue; 37 | 38 | public DebugMenuInteger(string path, Func getter, Action setter = null, int order = 0) 39 | : base(path, order) 40 | { 41 | this.getter = getter; 42 | this.setter = setter; 43 | format = DEFAULT_FORMAT; 44 | step = 1; 45 | defaultValue = getter(); 46 | Render(); 47 | } 48 | 49 | public DebugMenuInteger(DebugMenu parentMenu, string path, Func getter, Action setter = null, int order = 0) 50 | : base(parentMenu, path, order) 51 | { 52 | this.getter = getter; 53 | this.setter = setter; 54 | format = DEFAULT_FORMAT; 55 | step = 1; 56 | defaultValue = getter(); 57 | Render(); 58 | } 59 | 60 | public override void OnEvent(EvenTag tag) 61 | { 62 | switch (tag) 63 | { 64 | case EvenTag.Render: 65 | Render(); 66 | break; 67 | case EvenTag.Right: 68 | setter?.Invoke(getter() + step * KeyboardModificationSpeed); 69 | Render(); 70 | OnModified(); 71 | break; 72 | case EvenTag.Left: 73 | setter?.Invoke(getter() - step * KeyboardModificationSpeed); 74 | Render(); 75 | OnModified(); 76 | break; 77 | case EvenTag.Reset: 78 | setter?.Invoke(defaultValue); 79 | Render(); 80 | OnModified(); 81 | break; 82 | } 83 | } 84 | 85 | private void Render() 86 | { 87 | var val = getter(); 88 | var def = val == defaultValue; 89 | value = string.Format(format,val); 90 | valueColor = def ? Colors.ValueDefault : Colors.ValueModified; 91 | labelColor = def ? Colors.LabelDefault : Colors.LabelModified; 92 | } 93 | 94 | private void OnModified() 95 | { 96 | if (DebugMenuSystem.isVisible) 97 | return; 98 | DebugMenuSystem.FlashText($"{label} {value}"); 99 | } 100 | 101 | public DebugMenuInteger Step(int value) 102 | { 103 | step = value; 104 | return this; 105 | } 106 | 107 | public DebugMenuInteger Format(string value) 108 | { 109 | format = value ?? DEFAULT_FORMAT; 110 | return this; 111 | } 112 | 113 | public DebugMenuInteger Default(int value) 114 | { 115 | defaultValue = value; 116 | return this; 117 | } 118 | } 119 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuItem.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using UnityEngine; 26 | 27 | namespace XiDebugMenu 28 | { 29 | public abstract class DebugMenuItem 30 | { 31 | public DebugMenu parentMenu; //< the menu of this item 32 | public int order; //< sorting menu items and group them by similarities 33 | public readonly string label; //< at left side of menu item 34 | public string value; //< at right side of menu item 35 | public string labelColor; //< label color 36 | public string valueColor; //< value color 37 | 38 | public enum EvenTag 39 | { 40 | Null, //< Nothing 41 | Render, //< Render item, update label, value and colors 42 | Up, //< Go to previous item 43 | Down, //< Go to next item 44 | Left, //< Go to previous menu or decrease value or call action 45 | Right, //< Go to next menu or increase value or call action 46 | Reset, //< Reset value to default 47 | OpenMenu, //< When menu open 48 | CloseMenu, //< When menu closed 49 | ToggleMenu, //< Show/Hide menu 50 | ToggleQuickMenu, //< Show/Hide exact menu 51 | } 52 | 53 | public enum EventResult 54 | { 55 | Null, 56 | Reset, 57 | Modified, 58 | Called, 59 | } 60 | 61 | protected DebugMenuItem(string path, int order) 62 | { 63 | var pathOnly = DebugMenuTools.GetDirectoryName(path); 64 | label = DebugMenuTools.GetFileName(path); 65 | parentMenu = DebugMenuSystem.RootDebugMenu.GetOrCreateMenu(pathOnly); 66 | this.order = order; 67 | labelColor = Colors.ToggleLabelDisabled; 68 | valueColor = Colors.ToggleLabelDisabled; 69 | parentMenu.AddItem(this); 70 | } 71 | 72 | protected DebugMenuItem(DebugMenu parentMenu, string label, int order) 73 | { 74 | this.label = label; 75 | this.parentMenu = parentMenu; 76 | this.order = order; 77 | labelColor = Colors.ToggleLabelDisabled; 78 | valueColor = Colors.ToggleLabelDisabled; 79 | parentMenu?.AddItem(this); 80 | } 81 | 82 | public virtual void OnEvent(EvenTag tag) 83 | { 84 | // override this method to make specific menu item 85 | } 86 | 87 | public override string ToString() { return $"MenuItem[{label}]"; } 88 | 89 | protected int KeyboardModificationSpeed 90 | { 91 | get => Input.GetKey(KeyCode.LeftShift) ? (Input.GetKey(KeyCode.LeftControl) ? 100 : 10) : 1; 92 | } 93 | 94 | // ============================================================================================================= 95 | // Syntax sugar (Can be removed) 96 | // ============================================================================================================= 97 | 98 | /// 99 | /// Menu will group items with equal or +1 difference to single block 100 | /// 101 | public DebugMenuItem Order(int order) 102 | { 103 | this.order = order; 104 | parentMenu.Sort(); 105 | return this; 106 | } 107 | 108 | public DebugMenuItem AddToMenu(DebugMenu menu) 109 | { 110 | parentMenu?.RemoveItem(this); 111 | parentMenu = menu; 112 | menu.AddItem(this); 113 | return this; 114 | } 115 | 116 | public virtual DebugMenuItem Value(string value) 117 | { 118 | this.value = value; 119 | return this; 120 | } 121 | 122 | public DebugMenuItem LabelColor(string value) 123 | { 124 | labelColor = value; 125 | return this; 126 | } 127 | 128 | public DebugMenuItem ValueColor(string value) 129 | { 130 | valueColor = value; 131 | return this; 132 | } 133 | 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /ProjectSettings/SceneTemplateSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "templatePinStates": [], 3 | "dependencyTypeInfos": [ 4 | { 5 | "userAdded": false, 6 | "type": "UnityEngine.AnimationClip", 7 | "ignore": false, 8 | "defaultInstantiationMode": 0, 9 | "supportsModification": true 10 | }, 11 | { 12 | "userAdded": false, 13 | "type": "UnityEditor.Animations.AnimatorController", 14 | "ignore": false, 15 | "defaultInstantiationMode": 0, 16 | "supportsModification": true 17 | }, 18 | { 19 | "userAdded": false, 20 | "type": "UnityEngine.AnimatorOverrideController", 21 | "ignore": false, 22 | "defaultInstantiationMode": 0, 23 | "supportsModification": true 24 | }, 25 | { 26 | "userAdded": false, 27 | "type": "UnityEditor.Audio.AudioMixerController", 28 | "ignore": false, 29 | "defaultInstantiationMode": 0, 30 | "supportsModification": true 31 | }, 32 | { 33 | "userAdded": false, 34 | "type": "UnityEngine.ComputeShader", 35 | "ignore": true, 36 | "defaultInstantiationMode": 1, 37 | "supportsModification": true 38 | }, 39 | { 40 | "userAdded": false, 41 | "type": "UnityEngine.Cubemap", 42 | "ignore": false, 43 | "defaultInstantiationMode": 0, 44 | "supportsModification": true 45 | }, 46 | { 47 | "userAdded": false, 48 | "type": "UnityEngine.GameObject", 49 | "ignore": false, 50 | "defaultInstantiationMode": 0, 51 | "supportsModification": true 52 | }, 53 | { 54 | "userAdded": false, 55 | "type": "UnityEditor.LightingDataAsset", 56 | "ignore": false, 57 | "defaultInstantiationMode": 0, 58 | "supportsModification": false 59 | }, 60 | { 61 | "userAdded": false, 62 | "type": "UnityEngine.LightingSettings", 63 | "ignore": false, 64 | "defaultInstantiationMode": 0, 65 | "supportsModification": true 66 | }, 67 | { 68 | "userAdded": false, 69 | "type": "UnityEngine.Material", 70 | "ignore": false, 71 | "defaultInstantiationMode": 0, 72 | "supportsModification": true 73 | }, 74 | { 75 | "userAdded": false, 76 | "type": "UnityEditor.MonoScript", 77 | "ignore": true, 78 | "defaultInstantiationMode": 1, 79 | "supportsModification": true 80 | }, 81 | { 82 | "userAdded": false, 83 | "type": "UnityEngine.PhysicMaterial", 84 | "ignore": false, 85 | "defaultInstantiationMode": 0, 86 | "supportsModification": true 87 | }, 88 | { 89 | "userAdded": false, 90 | "type": "UnityEngine.PhysicsMaterial2D", 91 | "ignore": false, 92 | "defaultInstantiationMode": 0, 93 | "supportsModification": true 94 | }, 95 | { 96 | "userAdded": false, 97 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile", 98 | "ignore": false, 99 | "defaultInstantiationMode": 0, 100 | "supportsModification": true 101 | }, 102 | { 103 | "userAdded": false, 104 | "type": "UnityEngine.Rendering.PostProcessing.PostProcessResources", 105 | "ignore": false, 106 | "defaultInstantiationMode": 0, 107 | "supportsModification": true 108 | }, 109 | { 110 | "userAdded": false, 111 | "type": "UnityEngine.Rendering.VolumeProfile", 112 | "ignore": false, 113 | "defaultInstantiationMode": 0, 114 | "supportsModification": true 115 | }, 116 | { 117 | "userAdded": false, 118 | "type": "UnityEditor.SceneAsset", 119 | "ignore": false, 120 | "defaultInstantiationMode": 0, 121 | "supportsModification": false 122 | }, 123 | { 124 | "userAdded": false, 125 | "type": "UnityEngine.Shader", 126 | "ignore": true, 127 | "defaultInstantiationMode": 1, 128 | "supportsModification": true 129 | }, 130 | { 131 | "userAdded": false, 132 | "type": "UnityEngine.ShaderVariantCollection", 133 | "ignore": true, 134 | "defaultInstantiationMode": 1, 135 | "supportsModification": true 136 | }, 137 | { 138 | "userAdded": false, 139 | "type": "UnityEngine.Texture", 140 | "ignore": false, 141 | "defaultInstantiationMode": 0, 142 | "supportsModification": true 143 | }, 144 | { 145 | "userAdded": false, 146 | "type": "UnityEngine.Texture2D", 147 | "ignore": false, 148 | "defaultInstantiationMode": 0, 149 | "supportsModification": true 150 | }, 151 | { 152 | "userAdded": false, 153 | "type": "UnityEngine.Timeline.TimelineAsset", 154 | "ignore": false, 155 | "defaultInstantiationMode": 0, 156 | "supportsModification": true 157 | } 158 | ], 159 | "defaultDependencyTypeInfo": { 160 | "userAdded": false, 161 | "type": "", 162 | "ignore": false, 163 | "defaultInstantiationMode": 1, 164 | "supportsModification": true 165 | }, 166 | "newSceneOverride": 0 167 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuSystem.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace XiDebugMenu 4 | { 5 | public class DebugMenuSystem 6 | { 7 | public enum Menu 8 | { 9 | 10 | } 11 | public static readonly DebugMenu RootDebugMenu = new DebugMenu(null, "Debug Menu"); 12 | public static readonly DebugMenu RootQuickMenu = new DebugMenu(null, "Quick Menu"); 13 | public static DebugMenuRepresentation debugMenuRepresentation; 14 | public static AlertBoxRepresentation alertBoxRepresentation; 15 | public static DebugMenu currentMenu; 16 | public static bool isVisible; 17 | private static float autoRefreshAt; 18 | private static bool autoRefresh; 19 | private static DebugMenuController controller; 20 | 21 | /// 22 | /// Initialize menu system 23 | /// 24 | public static void Initialize() 25 | { 26 | controller = new DebugMenuController(); 27 | debugMenuRepresentation = Object.FindObjectOfType(); 28 | Debug.Assert(debugMenuRepresentation != null); 29 | alertBoxRepresentation = Object.FindObjectOfType(); 30 | Debug.Assert(alertBoxRepresentation != null); 31 | } 32 | 33 | /// 34 | /// DeInitialize menu system 35 | /// 36 | public static void DeInitialize() 37 | { 38 | SetVisible(false); 39 | RootDebugMenu.ClearDownTree(); 40 | debugMenuRepresentation = null; 41 | currentMenu = null; 42 | } 43 | 44 | public static void Update() 45 | { 46 | 47 | // Refresh menu time to time if autoRefreshPeriod is more than zero 48 | if (autoRefresh && Time.unscaledTime > autoRefreshAt) 49 | currentMenu.RequestRefresh(); 50 | 51 | var evt = controller.GetEvet(); 52 | if (evt != DebugMenuItem.EvenTag.Null) 53 | SendEvent(evt); 54 | 55 | if (currentMenu == null) 56 | return; 57 | 58 | if (currentMenu.DoRefresh) 59 | Render(); 60 | } 61 | 62 | public static void SendEvent(DebugMenuItem.EvenTag tag) 63 | { 64 | if (tag == DebugMenuItem.EvenTag.ToggleMenu) 65 | { 66 | if (isVisible) 67 | { 68 | SetVisible(false); 69 | } 70 | else 71 | { 72 | currentMenu = RootDebugMenu; 73 | SetVisible(true); 74 | } 75 | } 76 | else if (tag == DebugMenuItem.EvenTag.ToggleQuickMenu) 77 | { 78 | if (isVisible) 79 | { 80 | SetVisible(false); 81 | } 82 | else 83 | { 84 | currentMenu = RootQuickMenu; 85 | SetVisible(true); 86 | } 87 | } 88 | else if (tag == DebugMenuItem.EvenTag.CloseMenu) 89 | { 90 | CloseMenu(); 91 | } 92 | else 93 | { 94 | if (currentMenu != null) 95 | { 96 | currentMenu.OnEvent(tag); 97 | if (isVisible) 98 | Render(); 99 | } 100 | } 101 | } 102 | 103 | // ============================================================================================================= 104 | // Show/Hide/Toggle 105 | // ============================================================================================================= 106 | 107 | public static void SetVisible(bool state) 108 | { 109 | isVisible = state; 110 | debugMenuRepresentation?.SetVisible(state); 111 | Render(); 112 | } 113 | 114 | // ============================================================================================================= 115 | // Render new or previous menu 116 | // ============================================================================================================= 117 | 118 | public static void OpenMenu(DebugMenu debugMenu) 119 | { 120 | currentMenu = debugMenu; 121 | debugMenu.OnEvent(DebugMenuItem.EvenTag.OpenMenu); 122 | Render(); 123 | } 124 | 125 | public static void CloseMenu() 126 | { 127 | if (currentMenu == null) 128 | return; 129 | if (currentMenu.parentMenu == null) 130 | { 131 | SetVisible(false); 132 | } 133 | else 134 | { 135 | currentMenu.OnEvent(DebugMenuItem.EvenTag.CloseMenu); 136 | OpenMenu(currentMenu.parentMenu); 137 | Render(); 138 | } 139 | } 140 | 141 | // ============================================================================================================= 142 | // Render new or previous menu 143 | // ============================================================================================================= 144 | 145 | private static void Render() 146 | { 147 | if (currentMenu == null) 148 | return; 149 | currentMenu.DoRefresh = false; 150 | autoRefresh = currentMenu.autoRefreshPeriod > 0; 151 | autoRefreshAt = Time.unscaledTime + currentMenu.autoRefreshPeriod; 152 | debugMenuRepresentation.SetText(MenuTextRenderer.RenderMenu(currentMenu, currentMenu.currentLine)); 153 | } 154 | 155 | // ============================================================================================================= 156 | // Representation 157 | // ============================================================================================================= 158 | 159 | public static void FlashText(string text) 160 | { 161 | alertBoxRepresentation?.FlashText(text); 162 | } 163 | 164 | } 165 | } -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Stadia: 5 227 | Standalone: 5 228 | WebGL: 3 229 | Windows Store Apps: 5 230 | XboxOne: 5 231 | iPhone: 2 232 | tvOS: 2 233 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # XiDebugMenu 2 | ## _The elegant and easy to use debug menu for Unity 3D_ 3 | 4 | ![](https://img.shields.io/badge/unity-2018.3%20or%20later-green.svg) 5 | [![⚙ Build and Release](https://github.com/hww/XiDebugMenu/actions/workflows/ci.yml/badge.svg)](https://github.com/hww/XiDebugMenu/actions/workflows/ci.yml) 6 | [![openupm](https://img.shields.io/npm/v/com.hww.xidebugmenu?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.hww.xidebugmenu/) 7 | [![](https://img.shields.io/github/license/hww/XiDebugMenu.svg)](https://github.com/hww/XiDebugMenu/blob/master/LICENSE) 8 | [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) 9 | 10 | It is easy to use, lightweight library initially forked from [wataru-ito/DebugMenu](https://github.com/wataru-ito/DebugMenu) but deeply modifyed by [hww](https://github.com/hww) 11 | 12 | ## Introduction 13 | 14 | An easy to use debug menu with little memory requirement. Influenced by the Emacs menu system. The basic concept is the minimum number of lines to add items to the menu (one line per option) and the procedural generation of menu items. 15 | 16 | ## Alternative 17 | 18 | This project designed for simplicity, for example it has limited amout of types for menu items. If you need more then consider to use the advanced version [extDebug](https://github.com/Iam1337/extDebug). It has much more features and I believe you will have a professional support from autor [Iam1337](https://github.com/Iam1337). 19 | 20 | The other alternative is my advanced menu [XiKeyboard](https://github.com/hww/XiKeyboard) with advanced keystrokes systems. 21 | 22 | ## Install 23 | 24 | The package is available on the openupm registry. You can install it via openupm-cli. 25 | 26 | ```bash 27 | openupm add com.hww.xidebugmenu 28 | ``` 29 | You can also install via git url by adding this entry in your manifest.json 30 | 31 | ```bash 32 | "com.hww.xidebugmenu": "https://github.com/hww/XiDebugMenu.git#upm" 33 | ``` 34 | ## Usage 35 | 36 | A demonstration of how to use it is below: 37 | 38 | ```C# 39 | 40 | // The fields to modify by menu 41 | public enum TrafficLight { Red,Green, Blue } 42 | public TrafficLight enumValue; 43 | public bool toggleValue; 44 | public int integerValue; 45 | public float floatValue; 46 | 47 | // Create new menu 48 | new DebugMenu("Edit/Preferences"); 49 | new DebugMenuToggle("Edit/Preferences/Toggle", () => toggleValue, value => toggleValue = value, 1); 50 | new DebugMenuInteger("Edit/Preferences/Integer", () => integerValue, value => integerValue = value, 2); 51 | new DebugMenuFloat("Edit/Preferences/Float", () => floatValue, value => floatValue = value, 3); 52 | new DebugMenuAction("Edit/Preferences/Action", (item,tag) => { Debug.Log("Action"); }, 4); 53 | new DebugMenuEnum("Edit/Preferences/TraficLight", () => enumValue, value => enumValue = value, 5); 54 | new DebugMenu("Edit/Preferences/Extra Preferences", 10); 55 | ``` 56 | 57 | ![Picture1](Documentation/menu-picture1.png) 58 | ![Picture2](Documentation/menu-picture2.png) 59 | ![Picture3](Documentation/menu-picture3.png) 60 | 61 | Other way is to add items directly to menu. 62 | 63 | ```C# 64 | var menu, new DebugMenu("Edit/Preferences"); 65 | new DebugMenuToggle(menu, "Toggle", () => toggleValue, value => toggleValue = value, 1); 66 | new DebugMenuInteger( menu, "Integer",() => integerValue, value => integerValue = value, 2); 67 | new DebugMenuFloat(menu, "Float", () => floatValue, value => floatValue = value, 3); 68 | new DebugMenuAction(menu, "Action", (item,tag) => { Debug.Log("Action"); }, 4); 69 | new DebugMenuEnum(menu, "TraficLight", () => enumValue, value => enumValue = value, 5); 70 | ``` 71 | 72 | ## Default Value 73 | 74 | For integer, floats and enum types creating new DebugMenuItem will capture current value as defaut. When value is default it displayed as bright green color. Information about other color tags see below. 75 | 76 | - **booleans** 77 | - yellow _color of label for enabed feture_ 78 | - white _color of label for disabled feature_ 79 | - **integers**, **floats**, **enums** 80 | - bright green _color of value for default_ 81 | - yellow _color of value and label for not default value_ 82 | - **actions** 83 | - gray _color for inactive action_ 84 | - other _color for active action_ 85 | 86 | ## Keyboard Shortcuts 87 | 88 | - E show or hide menu without closing it 89 | - ESC close current menu and display previous, or hide menu if there are no more 90 | - W,S move previous and next menu item 91 | - A,D edit menu item, open close submenu 92 | - R reset value to default 93 | - Shift-A,Shift-D edit menu item even if menu is closed 94 | - Shift-R reset value to default even if menu is closed 95 | 96 | ## Events 97 | 98 | Menu manager sends messages to menu items for rendering and modifying items . 99 | 100 | ```C# 101 | public enum EvenTag 102 | { 103 | Null, //< Nothing 104 | Render, //< Render item, update label, value and colors 105 | Left, //< Decrease value or call action 106 | Right, //< Increase value or call action 107 | Up, //< Go to previous item 108 | Down, //< Go to next item 109 | Reset, //< Reset value to default 110 | OpenMenu, //< When menu open 111 | CloseMenu //< When menu closed 112 | } 113 | ``` 114 | ## Actions 115 | 116 | The action code can update the item's fields, and differently response for events: Inc,Dec and Reset 117 | 118 | ```C# 119 | new DebugMenuAction("Edit/Preferences/Action", (item,tag) => { 120 | switch (tag) 121 | { 122 | case EventTag.Right: 123 | item.value = "Increment"; 124 | break; 125 | case EventTag.Left: 126 | item.value = "Decrement"; 127 | break; 128 | ... 129 | } 130 | }, 1); 131 | ``` 132 | 133 | ## Open and Close Menu Events 134 | 135 | Possible to add menu items when menu opens, and remove items when it closes. 136 | 137 | ```C# 138 | new DebugMenu("Edit/Preferences/Extra Preferences", 30) 139 | .OnOpen(menu => 140 | { 141 | new DebugMenuToggle("Toggle2", menu, () => toggleValue, value => toggleValue = value); 142 | }) 143 | .OnClose(menu => 144 | { 145 | menu.Clear(); 146 | }); 147 | ``` 148 | 149 | ## Refresh and AutoRefresh Menu 150 | 151 | If values in menu can be modified by game, to display it the menu should be rendered time to time. 152 | 153 | ```C# 154 | new DebugMenu("Edit/Preferences").AutoRefresh(1f); 155 | ``` 156 | 157 | Set value 0 will never refresh menu. Alternative way is calling _RequestRefresh_ method. 158 | 159 | ```C# 160 | menu.RequestRefresh() 161 | ``` 162 | ## Increment Step and Precision 163 | 164 | For integers and floats: The _step_ field is a step for _Inc_ and _Dec_ evens. The _format_ field is argument for ToString(...) method. 165 | 166 | **For floats** The _precision_ field is number of digits after period. For example _increment=5_ and _precision=2_ will make increment step 0.05 167 | 168 | ## Other Syntax Sugar 169 | 170 | ```C# 171 | // For DebugMenu class 172 | DebugMenu OnOpen(Action onOpen) 173 | DebugMenu OnClose(Action onClose) 174 | DebugMenu AutoRefresh(float period) 175 | 176 | // For MenuItem class 177 | DebugMenuItem Order(int order) 178 | DebugMenuItem AddToMenu(DebugMenu menu) 179 | DebugMenuItem Value(string value) 180 | DebugMenuItem LabelColor(string value) 181 | DebugMenuItem ValueColor(string value) 182 | 183 | // For DebugMenuEnum class 184 | DebugMenuEnum Default(T value) 185 | 186 | // For DebugMenuInteger class 187 | DebugMenuInteger Default(int value) 188 | DebugMenuInteger Step(int value) 189 | DebugMenuInteger Format(string value) 190 | 191 | // For DebugMenuFloat class 192 | DebugMenuFloat Default(float value) 193 | DebugMenuFloat Precision(int value) 194 | DebugMenuFloat Step(int value) 195 | DebugMenuFloat Format(string value) 196 | ``` 197 | 198 | 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/README.md: -------------------------------------------------------------------------------- 1 | # XiDebugMenu 2 | ## _The elegant and easy to use debug menu for Unity 3D_ 3 | 4 | ![](https://img.shields.io/badge/unity-2018.3%20or%20later-green.svg) 5 | [![⚙ Build and Release](https://github.com/hww/XiDebugMenu/actions/workflows/ci.yml/badge.svg)](https://github.com/hww/XiDebugMenu/actions/workflows/ci.yml) 6 | [![openupm](https://img.shields.io/npm/v/com.hww.xidebugmenu?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.hww.xidebugmenu/) 7 | [![](https://img.shields.io/github/license/hww/XiDebugMenu.svg)](https://github.com/hww/XiDebugMenu/blob/master/LICENSE) 8 | [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) 9 | 10 | It is easy to use, lightweight library initially forked from [wataru-ito/DebugMenu](https://github.com/wataru-ito/DebugMenu) but deeply modifyed by [hww](https://github.com/hww) 11 | 12 | ## Introduction 13 | 14 | An easy to use debug menu with little memory requirement. Influenced by the Emacs menu system. The basic concept is the minimum number of lines to add items to the menu (one line per option) and the procedural generation of menu items. 15 | 16 | ## Alternative 17 | 18 | This project designed for simplicity, for example it has limited amout of types for menu items. If you need more then consider to use the advanced version [extDebug](https://github.com/Iam1337/extDebug). It has much more features and I believe you will have a professional support from autor [Iam1337](https://github.com/Iam1337). 19 | 20 | ## Install 21 | 22 | The package is available on the openupm registry. You can install it via openupm-cli. 23 | 24 | ```bash 25 | openupm add com.hww.xidebugmenu 26 | ``` 27 | You can also install via git url by adding this entry in your manifest.json 28 | 29 | ```bash 30 | "com.hww.xidebugmenu": "https://github.com/hww/XiDebugMenu.git#upm" 31 | ``` 32 | ## Usage 33 | 34 | A demonstration of how to use it is below: 35 | 36 | ```C# 37 | 38 | // The fields to modify by menu 39 | public enum TrafficLight { Red,Green, Blue } 40 | public TrafficLight enumValue; 41 | public bool toggleValue; 42 | public int integerValue; 43 | public float floatValue; 44 | 45 | // Create new menu 46 | new DebugMenu("Edit/Preferences"); 47 | new DebugMenuToggle("Edit/Preferences/Toggle", () => toggleValue, value => toggleValue = value, 1); 48 | new DebugMenuInteger("Edit/Preferences/Integer", () => integerValue, value => integerValue = value, 2); 49 | new DebugMenuFloat("Edit/Preferences/Float", () => floatValue, value => floatValue = value, 3); 50 | new DebugMenuAction("Edit/Preferences/Action", (item,tag) => { Debug.Log("Action"); }, 4); 51 | new DebugMenuEnum("Edit/Preferences/TraficLight", () => enumValue, value => enumValue = value, 5); 52 | new DebugMenu("Edit/Preferences/Extra Preferences", 10); 53 | ``` 54 | 55 | ![Picture1](Documentation/menu-picture1.png) 56 | ![Picture2](Documentation/menu-picture2.png) 57 | ![Picture3](Documentation/menu-picture3.png) 58 | 59 | Other way is to add items directly to menu. 60 | 61 | ```C# 62 | var menu, new DebugMenu("Edit/Preferences"); 63 | new DebugMenuToggle(menu, "Toggle", () => toggleValue, value => toggleValue = value, 1); 64 | new DebugMenuInteger( menu, "Integer",() => integerValue, value => integerValue = value, 2); 65 | new DebugMenuFloat(menu, "Float", () => floatValue, value => floatValue = value, 3); 66 | new DebugMenuAction(menu, "Action", (item,tag) => { Debug.Log("Action"); }, 4); 67 | new DebugMenuEnum(menu, "TraficLight", () => enumValue, value => enumValue = value, 5); 68 | ``` 69 | 70 | ## Default Value 71 | 72 | For integer, floats and enum types creating new DebugMenuItem will capture current value as defaut. When value is default it displayed as bright green color. Information about other color tags see below. 73 | 74 | - **booleans** 75 | - yellow _color of label for enabed feture_ 76 | - white _color of label for disabled feature_ 77 | - **integers**, **floats**, **enums** 78 | - bright green _color of value for default_ 79 | - yellow _color of value and label for not default value_ 80 | - **actions** 81 | - gray _color for inactive action_ 82 | - other _color for active action_ 83 | 84 | ## Keyboard Shortcuts 85 | 86 | - E show or hide menu without closing it 87 | - ESC close current menu and display previous, or hide menu if there are no more 88 | - W,S move previous and next menu item 89 | - A,D edit menu item, open close submenu 90 | - R reset value to default 91 | - Shift-A,Shift-D edit menu item even if menu is closed 92 | - Shift-R reset value to default even if menu is closed 93 | 94 | ## Events 95 | 96 | Menu manager sends messages to menu items for rendering and modifying items . 97 | 98 | ```C# 99 | public enum EvenTag 100 | { 101 | Null, //< Nothing 102 | Render, //< Render item, update label, value and colors 103 | Left, //< Decrease value or call action 104 | Right, //< Increase value or call action 105 | Up, //< Go to previous item 106 | Down, //< Go to next item 107 | Reset, //< Reset value to default 108 | OpenMenu, //< When menu open 109 | CloseMenu //< When menu closed 110 | } 111 | ``` 112 | ## Actions 113 | 114 | The action code can update the item's fields, and differently response for events: Inc,Dec and Reset 115 | 116 | ```C# 117 | new DebugMenuAction("Edit/Preferences/Action", (item,tag) => { 118 | switch (tag) 119 | { 120 | case EventTag.Right: 121 | item.value = "Increment"; 122 | break; 123 | case EventTag.Left: 124 | item.value = "Decrement"; 125 | break; 126 | ... 127 | } 128 | }, 1); 129 | ``` 130 | 131 | ## Open and Close Menu Events 132 | 133 | Possible to add menu items when menu opens, and remove items when it closes. 134 | 135 | ```C# 136 | new DebugMenu("Edit/Preferences/Extra Preferences", 30) 137 | .OnOpen(menu => 138 | { 139 | new DebugMenuToggle("Toggle2", menu, () => toggleValue, value => toggleValue = value); 140 | }) 141 | .OnClose(menu => 142 | { 143 | menu.Clear(); 144 | }); 145 | ``` 146 | 147 | ## Refresh and AutoRefresh Menu 148 | 149 | If values in menu can be modified by game, to display it the menu should be rendered time to time. 150 | 151 | ```C# 152 | new DebugMenu("Edit/Preferences").AutoRefresh(1f); 153 | ``` 154 | 155 | Set value 0 will never refresh menu. Alternative way is calling _RequestRefresh_ method. 156 | 157 | ```C# 158 | menu.RequestRefresh() 159 | ``` 160 | ## Increment Step and Precision 161 | 162 | For integers and floats: The _step_ field is a step for _Inc_ and _Dec_ evens. The _format_ field is argument for ToString(...) method. 163 | 164 | **For floats** The _precision_ field is number of digits after period. For example _increment=5_ and _precision=2_ will make increment step 0.05 165 | 166 | ## Other Syntax Sugar 167 | 168 | ```C# 169 | // For DebugMenu class 170 | DebugMenu OnOpen(Action onOpen) 171 | DebugMenu OnClose(Action onClose) 172 | DebugMenu AutoRefresh(float period) 173 | 174 | // For MenuItem class 175 | DebugMenuItem Order(int order) 176 | DebugMenuItem AddToMenu(DebugMenu menu) 177 | DebugMenuItem Value(string value) 178 | DebugMenuItem LabelColor(string value) 179 | DebugMenuItem ValueColor(string value) 180 | 181 | // For DebugMenuEnum class 182 | DebugMenuEnum Default(T value) 183 | 184 | // For DebugMenuInteger class 185 | DebugMenuInteger Default(int value) 186 | DebugMenuInteger Step(int value) 187 | DebugMenuInteger Format(string value) 188 | 189 | // For DebugMenuFloat class 190 | DebugMenuFloat Default(float value) 191 | DebugMenuFloat Precision(int value) 192 | DebugMenuFloat Step(int value) 193 | DebugMenuFloat Format(string value) 194 | ``` 195 | 196 | 197 | 198 | 199 | 200 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenuFloat.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System; 26 | using UnityEngine; 27 | using XiCore.UnityExtensions; 28 | 29 | namespace XiDebugMenu 30 | { 31 | public class DebugMenuFloat : DebugMenuItem 32 | { 33 | private const int DEFAULT_STEP = 1; 34 | private const int DEFAULT_PRECISION = 2; 35 | private const int MAX_PRECISION = 8; 36 | private const int MIN_PRECISION = 0; 37 | private readonly Func getter; 38 | private readonly Action setter; 39 | private int step; 40 | private int floatingPointScale; //< multiply value before increment, divide after 41 | private string format; 42 | private float defaultValue; 43 | private int precision; 44 | 45 | private static readonly string[] formats = new[] 46 | { 47 | "0", "0.0", "0.00", "0.000", "0.0000", "0.00000", "0.000000", "0.0000000", "0.00000000" 48 | }; 49 | 50 | public DebugMenuFloat(string path, Func getter, Action setter = null, int order = 0) 51 | : base(path, order) 52 | { 53 | this.getter = getter; 54 | this.setter = setter; 55 | defaultValue = getter(); 56 | step = DEFAULT_STEP; 57 | Precision(DEFAULT_PRECISION); 58 | Render(); 59 | } 60 | 61 | public DebugMenuFloat(DebugMenu parentMenu, string label, Func getter, Action setter = null, 62 | int order = 0) 63 | : base(parentMenu, label, order) 64 | { 65 | this.getter = getter; 66 | this.setter = setter; 67 | defaultValue = getter(); 68 | step = DEFAULT_STEP; 69 | Precision(DEFAULT_PRECISION); 70 | Render(); 71 | } 72 | 73 | public override void OnEvent(EvenTag tag) 74 | { 75 | switch (tag) 76 | { 77 | case EvenTag.Render: 78 | Render(); 79 | break; 80 | case EvenTag.Right: 81 | setter?.Invoke((float)(Math.Floor(getter() * floatingPointScale + 0.1f) + step * KeyboardModificationSpeed) / floatingPointScale); 82 | Render(); 83 | OnModified(); 84 | break; 85 | case EvenTag.Left: 86 | setter?.Invoke((float)(Math.Floor(getter() * floatingPointScale + 0.1f) - step * KeyboardModificationSpeed) / floatingPointScale); 87 | Render(); 88 | OnModified(); 89 | break; 90 | case EvenTag.Reset: 91 | setter?.Invoke(defaultValue); 92 | Render(); 93 | OnModified(); 94 | break; 95 | } 96 | } 97 | 98 | private void Render() 99 | { 100 | var val = getter(); 101 | var def = val == defaultValue; 102 | value = val.ToString(format); 103 | valueColor = def ? Colors.ValueDefault : Colors.ValueModified; 104 | labelColor = def ? Colors.LabelDefault : Colors.LabelModified; 105 | } 106 | 107 | private void OnModified() 108 | { 109 | if (DebugMenuSystem.isVisible) 110 | return; 111 | DebugMenuSystem.FlashText($"{label} {value}"); 112 | } 113 | 114 | public DebugMenuFloat Precision(int value) 115 | { 116 | Debug.Assert(value >= MIN_PRECISION && value <= MAX_PRECISION); 117 | precision = value; 118 | format = format ?? formats[value]; 119 | floatingPointScale = (int)Math.Pow(10, value); // precision is digits after dot 120 | return this; 121 | } 122 | 123 | public DebugMenuFloat Format(string value) 124 | { 125 | format = value ?? formats[precision]; 126 | return this; 127 | } 128 | 129 | public DebugMenuFloat Step(int value) 130 | { 131 | step = value; 132 | return this; 133 | } 134 | 135 | public DebugMenuFloat Default(float value) 136 | { 137 | defaultValue = value; 138 | return this; 139 | } 140 | } 141 | 142 | 143 | public class DebugMenuVector3 144 | { 145 | private readonly DebugMenuFloat x; 146 | private readonly DebugMenuFloat y; 147 | private readonly DebugMenuFloat z; 148 | 149 | public DebugMenuVector3(string path, Func getter, Action setter = null, int order = 0) 150 | { 151 | x = new DebugMenuFloat(path + ".x", () => getter.Invoke().x, (x) => setter.Invoke(getter.Invoke().WithX(x)), order); 152 | y = new DebugMenuFloat(path + ".y", () => getter.Invoke().y, (y) => setter.Invoke(getter.Invoke().WithY(y)), order + 1); 153 | z = new DebugMenuFloat(path + ".z", () => getter.Invoke().z, (z) => setter.Invoke(getter.Invoke().WithZ(z)), order + 2); 154 | } 155 | 156 | public DebugMenuVector3(DebugMenu parentMenu, string label, Func getter, Action setter = null, 157 | int order = 0) 158 | { 159 | x = new DebugMenuFloat(parentMenu, label + ".x", () => getter.Invoke().x, (x) => setter.Invoke(getter.Invoke().WithX(x)), order); 160 | y = new DebugMenuFloat(parentMenu, label + ".y", () => getter.Invoke().y, (y) => setter.Invoke(getter.Invoke().WithY(y)), order + 1); 161 | z = new DebugMenuFloat(parentMenu, label + ".z", () => getter.Invoke().z, (z) => setter.Invoke(getter.Invoke().WithZ(z)), order + 2); 162 | } 163 | 164 | public DebugMenuVector3 Precision(int value) 165 | { 166 | x.Precision(value); 167 | y.Precision(value); 168 | z.Precision(value); 169 | return this; 170 | } 171 | 172 | public DebugMenuVector3 Format(string value) 173 | { 174 | x.Format(value); 175 | y.Format(value); 176 | z.Format(value); 177 | return this; 178 | } 179 | 180 | public DebugMenuVector3 Step(int value) 181 | { 182 | x.Step(value); 183 | y.Step(value); 184 | z.Step(value); 185 | return this; 186 | } 187 | 188 | public DebugMenuVector3 Default(float value) 189 | { 190 | x.Default(value); 191 | y.Default(value); 192 | z.Default(value); 193 | return this; 194 | } 195 | } 196 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/MenuTextRenderer.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System; 26 | using XiCore.StringTools; 27 | 28 | namespace XiDebugMenu 29 | { 30 | 31 | public class MenuTextRenderer 32 | { 33 | private const string SUFFIX = " "; 34 | private const string PREFIX = " "; 35 | private const string PREFIX_SELECTED = ">"; 36 | private const string SPACE = " "; 37 | private const char CHAR_SQUARE_DOT = '▪'; 38 | private const char CHAR_DASHED_LINE = '-'; 39 | private const char CHAR_NBSP = (char)0xA0; 40 | private const char CHAR_LIGHT_HORIZONTAL = '─'; 41 | 42 | private const string upperLineFormat = "┌{0}┐"; 43 | private const string middleLineFormat = "├{0}┤"; 44 | private const string bottomLineFormat = "└{0}┘"; 45 | private const string menuLineFormat = "│{0}│"; 46 | 47 | private static readonly BetterStringBuilder stringBuilder = new BetterStringBuilder(80*40); 48 | 49 | 50 | public enum MenuOptions 51 | { 52 | Default 53 | } 54 | 55 | 56 | public static string RenderMenu(DebugMenu debugMenu, int selected, 57 | MenuOptions options = MenuOptions.Default) 58 | { 59 | stringBuilder.Clear(); 60 | // update texts and the width of the fields 61 | debugMenu.SendToChildren(DebugMenuItem.EvenTag.Render); 62 | var menuCount = debugMenu.Count; 63 | 64 | debugMenu.UpdateWidth(SPACE.Length); 65 | 66 | var lineWidth = debugMenu.widthOfNameAnValue + SUFFIX.Length + PREFIX.Length; 67 | 68 | string justLine = new string(CHAR_LIGHT_HORIZONTAL, lineWidth); 69 | 70 | 71 | string itemFormat1 = $"{{0}}{{1,-{debugMenu.widthOfNameAnValue}}}{{2}}"; 72 | string itemFormat2 = $"{{0}}{{1,-{debugMenu.widthOfName}}}{SPACE}{{2,{debugMenu.widthOfValue}}}{{3}}"; 73 | 74 | var menuName = string.Format(itemFormat1, PREFIX, debugMenu.label, SUFFIX, debugMenu.labelColor); 75 | stringBuilder.AppendLine(menuName); 76 | stringBuilder.AppendLine(justLine); 77 | 78 | var order = -1; 79 | 80 | for (var i = 0; i < menuCount; i++) 81 | { 82 | var isSelected = i == selected; 83 | var menuItem = debugMenu[i]; 84 | 85 | if (order >= 0 && Math.Abs(order - menuItem.order) > 1) 86 | stringBuilder.AppendLine(justLine); 87 | order = menuItem.order; 88 | 89 | var prefix = isSelected ? PREFIX_SELECTED : PREFIX; 90 | string item; 91 | if (menuItem is DebugMenu) 92 | { 93 | item = string.Format(itemFormat1, prefix, menuItem.label + "...", SUFFIX, menuItem.labelColor); 94 | } 95 | else 96 | { 97 | if (menuItem.label != null) 98 | { 99 | if (menuItem.value != null) 100 | item = string.Format(itemFormat2, prefix, menuItem.label, menuItem.value, SUFFIX, menuItem.labelColor, menuItem.valueColor); 101 | else 102 | item = string.Format(itemFormat1, prefix, menuItem.label, SUFFIX, menuItem.labelColor); 103 | } 104 | else 105 | { 106 | throw new ArgumentOutOfRangeException(); 107 | } 108 | } 109 | stringBuilder.AppendLine(item); 110 | } 111 | return stringBuilder.ToString(); 112 | } 113 | 114 | public static string RenderMenu_WithFrame(DebugMenu debugMenu, int selected, 115 | MenuOptions options = MenuOptions.Default) 116 | { 117 | stringBuilder.Clear(); 118 | // update texts and the width of the fields 119 | debugMenu.SendToChildren(DebugMenuItem.EvenTag.Render); 120 | var menuCount = debugMenu.Count; 121 | 122 | debugMenu.UpdateWidth(SPACE.Length); 123 | 124 | var lineWidth = debugMenu.widthOfNameAnValue + SUFFIX.Length + PREFIX.Length; 125 | 126 | string singleLine = null; 127 | string justLine = new string(CHAR_LIGHT_HORIZONTAL, lineWidth); 128 | 129 | 130 | string itemFormat1 = $"{{0}}{{1,-{debugMenu.widthOfNameAnValue}}}{{2}}"; 131 | string itemFormat2 = $"{{0}}{{1,-{debugMenu.widthOfName}}}{SPACE}{{2,{debugMenu.widthOfValue}}}{{3}}"; 132 | 133 | stringBuilder.AppendLine(string.Format( upperLineFormat, justLine)); 134 | var menuName = string.Format(itemFormat1, PREFIX, debugMenu.label, SUFFIX, debugMenu.labelColor); 135 | stringBuilder.AppendLine(string.Format(menuLineFormat, menuName)); 136 | stringBuilder.AppendLine(string.Format(middleLineFormat, justLine)); 137 | 138 | var order = -1; 139 | 140 | for (var i = 0; i < menuCount; i++) 141 | { 142 | var isSelected = i == selected; 143 | var menuItem = debugMenu[i]; 144 | 145 | if (order >= 0 && Math.Abs(order - menuItem.order) > 1) 146 | { 147 | 148 | if (singleLine == null) 149 | singleLine = string.Format(middleLineFormat,justLine); 150 | stringBuilder.AppendLine(singleLine); 151 | } 152 | 153 | order = menuItem.order; 154 | 155 | var prefix = isSelected ? PREFIX_SELECTED : PREFIX; 156 | string item; 157 | if (menuItem is DebugMenu) 158 | { 159 | item = string.Format(itemFormat1, prefix, menuItem.label + "...", SUFFIX, menuItem.labelColor); 160 | } 161 | else 162 | { 163 | if (menuItem.label != null) 164 | { 165 | if (menuItem.value != null) 166 | item = string.Format(itemFormat2, prefix, menuItem.label, menuItem.value, SUFFIX, menuItem.labelColor, menuItem.valueColor); 167 | else 168 | item = string.Format(itemFormat1, prefix, menuItem.label, SUFFIX, menuItem.labelColor); 169 | } 170 | else 171 | { 172 | throw new ArgumentOutOfRangeException(); 173 | } 174 | } 175 | stringBuilder.AppendLine(string.Format(menuLineFormat, item)); 176 | } 177 | stringBuilder.AppendLine(string.Format( bottomLineFormat, justLine)); 178 | return stringBuilder.ToString(); 179 | } 180 | } 181 | } -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.hww.xicore": { 4 | "version": "https://github.com/hww/XiCore.git#upm", 5 | "depth": 0, 6 | "source": "git", 7 | "dependencies": {}, 8 | "hash": "1917b2389f470c6cf435833db7a878dda976850d" 9 | }, 10 | "com.unity.collab-proxy": { 11 | "version": "1.17.2", 12 | "depth": 0, 13 | "source": "registry", 14 | "dependencies": { 15 | "com.unity.services.core": "1.0.1" 16 | }, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.ext.nunit": { 20 | "version": "1.0.6", 21 | "depth": 1, 22 | "source": "registry", 23 | "dependencies": {}, 24 | "url": "https://packages.unity.com" 25 | }, 26 | "com.unity.ide.rider": { 27 | "version": "3.0.15", 28 | "depth": 0, 29 | "source": "registry", 30 | "dependencies": { 31 | "com.unity.ext.nunit": "1.0.6" 32 | }, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.ide.visualstudio": { 36 | "version": "2.0.16", 37 | "depth": 0, 38 | "source": "registry", 39 | "dependencies": { 40 | "com.unity.test-framework": "1.1.9" 41 | }, 42 | "url": "https://packages.unity.com" 43 | }, 44 | "com.unity.ide.vscode": { 45 | "version": "1.2.5", 46 | "depth": 0, 47 | "source": "registry", 48 | "dependencies": {}, 49 | "url": "https://packages.unity.com" 50 | }, 51 | "com.unity.nuget.newtonsoft-json": { 52 | "version": "3.0.2", 53 | "depth": 2, 54 | "source": "registry", 55 | "dependencies": {}, 56 | "url": "https://packages.unity.com" 57 | }, 58 | "com.unity.services.core": { 59 | "version": "1.4.2", 60 | "depth": 1, 61 | "source": "registry", 62 | "dependencies": { 63 | "com.unity.modules.unitywebrequest": "1.0.0", 64 | "com.unity.nuget.newtonsoft-json": "3.0.2", 65 | "com.unity.modules.androidjni": "1.0.0" 66 | }, 67 | "url": "https://packages.unity.com" 68 | }, 69 | "com.unity.test-framework": { 70 | "version": "1.1.31", 71 | "depth": 0, 72 | "source": "registry", 73 | "dependencies": { 74 | "com.unity.ext.nunit": "1.0.6", 75 | "com.unity.modules.imgui": "1.0.0", 76 | "com.unity.modules.jsonserialize": "1.0.0" 77 | }, 78 | "url": "https://packages.unity.com" 79 | }, 80 | "com.unity.textmeshpro": { 81 | "version": "3.0.6", 82 | "depth": 0, 83 | "source": "registry", 84 | "dependencies": { 85 | "com.unity.ugui": "1.0.0" 86 | }, 87 | "url": "https://packages.unity.com" 88 | }, 89 | "com.unity.timeline": { 90 | "version": "1.6.4", 91 | "depth": 0, 92 | "source": "registry", 93 | "dependencies": { 94 | "com.unity.modules.director": "1.0.0", 95 | "com.unity.modules.animation": "1.0.0", 96 | "com.unity.modules.audio": "1.0.0", 97 | "com.unity.modules.particlesystem": "1.0.0" 98 | }, 99 | "url": "https://packages.unity.com" 100 | }, 101 | "com.unity.ugui": { 102 | "version": "1.0.0", 103 | "depth": 0, 104 | "source": "builtin", 105 | "dependencies": { 106 | "com.unity.modules.ui": "1.0.0", 107 | "com.unity.modules.imgui": "1.0.0" 108 | } 109 | }, 110 | "com.unity.visualscripting": { 111 | "version": "1.7.8", 112 | "depth": 0, 113 | "source": "registry", 114 | "dependencies": { 115 | "com.unity.ugui": "1.0.0", 116 | "com.unity.modules.jsonserialize": "1.0.0" 117 | }, 118 | "url": "https://packages.unity.com" 119 | }, 120 | "com.unity.modules.ai": { 121 | "version": "1.0.0", 122 | "depth": 0, 123 | "source": "builtin", 124 | "dependencies": {} 125 | }, 126 | "com.unity.modules.androidjni": { 127 | "version": "1.0.0", 128 | "depth": 0, 129 | "source": "builtin", 130 | "dependencies": {} 131 | }, 132 | "com.unity.modules.animation": { 133 | "version": "1.0.0", 134 | "depth": 0, 135 | "source": "builtin", 136 | "dependencies": {} 137 | }, 138 | "com.unity.modules.assetbundle": { 139 | "version": "1.0.0", 140 | "depth": 0, 141 | "source": "builtin", 142 | "dependencies": {} 143 | }, 144 | "com.unity.modules.audio": { 145 | "version": "1.0.0", 146 | "depth": 0, 147 | "source": "builtin", 148 | "dependencies": {} 149 | }, 150 | "com.unity.modules.cloth": { 151 | "version": "1.0.0", 152 | "depth": 0, 153 | "source": "builtin", 154 | "dependencies": { 155 | "com.unity.modules.physics": "1.0.0" 156 | } 157 | }, 158 | "com.unity.modules.director": { 159 | "version": "1.0.0", 160 | "depth": 0, 161 | "source": "builtin", 162 | "dependencies": { 163 | "com.unity.modules.audio": "1.0.0", 164 | "com.unity.modules.animation": "1.0.0" 165 | } 166 | }, 167 | "com.unity.modules.imageconversion": { 168 | "version": "1.0.0", 169 | "depth": 0, 170 | "source": "builtin", 171 | "dependencies": {} 172 | }, 173 | "com.unity.modules.imgui": { 174 | "version": "1.0.0", 175 | "depth": 0, 176 | "source": "builtin", 177 | "dependencies": {} 178 | }, 179 | "com.unity.modules.jsonserialize": { 180 | "version": "1.0.0", 181 | "depth": 0, 182 | "source": "builtin", 183 | "dependencies": {} 184 | }, 185 | "com.unity.modules.particlesystem": { 186 | "version": "1.0.0", 187 | "depth": 0, 188 | "source": "builtin", 189 | "dependencies": {} 190 | }, 191 | "com.unity.modules.physics": { 192 | "version": "1.0.0", 193 | "depth": 0, 194 | "source": "builtin", 195 | "dependencies": {} 196 | }, 197 | "com.unity.modules.physics2d": { 198 | "version": "1.0.0", 199 | "depth": 0, 200 | "source": "builtin", 201 | "dependencies": {} 202 | }, 203 | "com.unity.modules.screencapture": { 204 | "version": "1.0.0", 205 | "depth": 0, 206 | "source": "builtin", 207 | "dependencies": { 208 | "com.unity.modules.imageconversion": "1.0.0" 209 | } 210 | }, 211 | "com.unity.modules.subsystems": { 212 | "version": "1.0.0", 213 | "depth": 1, 214 | "source": "builtin", 215 | "dependencies": { 216 | "com.unity.modules.jsonserialize": "1.0.0" 217 | } 218 | }, 219 | "com.unity.modules.terrain": { 220 | "version": "1.0.0", 221 | "depth": 0, 222 | "source": "builtin", 223 | "dependencies": {} 224 | }, 225 | "com.unity.modules.terrainphysics": { 226 | "version": "1.0.0", 227 | "depth": 0, 228 | "source": "builtin", 229 | "dependencies": { 230 | "com.unity.modules.physics": "1.0.0", 231 | "com.unity.modules.terrain": "1.0.0" 232 | } 233 | }, 234 | "com.unity.modules.tilemap": { 235 | "version": "1.0.0", 236 | "depth": 0, 237 | "source": "builtin", 238 | "dependencies": { 239 | "com.unity.modules.physics2d": "1.0.0" 240 | } 241 | }, 242 | "com.unity.modules.ui": { 243 | "version": "1.0.0", 244 | "depth": 0, 245 | "source": "builtin", 246 | "dependencies": {} 247 | }, 248 | "com.unity.modules.uielements": { 249 | "version": "1.0.0", 250 | "depth": 0, 251 | "source": "builtin", 252 | "dependencies": { 253 | "com.unity.modules.ui": "1.0.0", 254 | "com.unity.modules.imgui": "1.0.0", 255 | "com.unity.modules.jsonserialize": "1.0.0", 256 | "com.unity.modules.uielementsnative": "1.0.0" 257 | } 258 | }, 259 | "com.unity.modules.uielementsnative": { 260 | "version": "1.0.0", 261 | "depth": 1, 262 | "source": "builtin", 263 | "dependencies": { 264 | "com.unity.modules.ui": "1.0.0", 265 | "com.unity.modules.imgui": "1.0.0", 266 | "com.unity.modules.jsonserialize": "1.0.0" 267 | } 268 | }, 269 | "com.unity.modules.umbra": { 270 | "version": "1.0.0", 271 | "depth": 0, 272 | "source": "builtin", 273 | "dependencies": {} 274 | }, 275 | "com.unity.modules.unityanalytics": { 276 | "version": "1.0.0", 277 | "depth": 0, 278 | "source": "builtin", 279 | "dependencies": { 280 | "com.unity.modules.unitywebrequest": "1.0.0", 281 | "com.unity.modules.jsonserialize": "1.0.0" 282 | } 283 | }, 284 | "com.unity.modules.unitywebrequest": { 285 | "version": "1.0.0", 286 | "depth": 0, 287 | "source": "builtin", 288 | "dependencies": {} 289 | }, 290 | "com.unity.modules.unitywebrequestassetbundle": { 291 | "version": "1.0.0", 292 | "depth": 0, 293 | "source": "builtin", 294 | "dependencies": { 295 | "com.unity.modules.assetbundle": "1.0.0", 296 | "com.unity.modules.unitywebrequest": "1.0.0" 297 | } 298 | }, 299 | "com.unity.modules.unitywebrequestaudio": { 300 | "version": "1.0.0", 301 | "depth": 0, 302 | "source": "builtin", 303 | "dependencies": { 304 | "com.unity.modules.unitywebrequest": "1.0.0", 305 | "com.unity.modules.audio": "1.0.0" 306 | } 307 | }, 308 | "com.unity.modules.unitywebrequesttexture": { 309 | "version": "1.0.0", 310 | "depth": 0, 311 | "source": "builtin", 312 | "dependencies": { 313 | "com.unity.modules.unitywebrequest": "1.0.0", 314 | "com.unity.modules.imageconversion": "1.0.0" 315 | } 316 | }, 317 | "com.unity.modules.unitywebrequestwww": { 318 | "version": "1.0.0", 319 | "depth": 0, 320 | "source": "builtin", 321 | "dependencies": { 322 | "com.unity.modules.unitywebrequest": "1.0.0", 323 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 324 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 325 | "com.unity.modules.audio": "1.0.0", 326 | "com.unity.modules.assetbundle": "1.0.0", 327 | "com.unity.modules.imageconversion": "1.0.0" 328 | } 329 | }, 330 | "com.unity.modules.vehicles": { 331 | "version": "1.0.0", 332 | "depth": 0, 333 | "source": "builtin", 334 | "dependencies": { 335 | "com.unity.modules.physics": "1.0.0" 336 | } 337 | }, 338 | "com.unity.modules.video": { 339 | "version": "1.0.0", 340 | "depth": 0, 341 | "source": "builtin", 342 | "dependencies": { 343 | "com.unity.modules.audio": "1.0.0", 344 | "com.unity.modules.ui": "1.0.0", 345 | "com.unity.modules.unitywebrequest": "1.0.0" 346 | } 347 | }, 348 | "com.unity.modules.vr": { 349 | "version": "1.0.0", 350 | "depth": 0, 351 | "source": "builtin", 352 | "dependencies": { 353 | "com.unity.modules.jsonserialize": "1.0.0", 354 | "com.unity.modules.physics": "1.0.0", 355 | "com.unity.modules.xr": "1.0.0" 356 | } 357 | }, 358 | "com.unity.modules.wind": { 359 | "version": "1.0.0", 360 | "depth": 0, 361 | "source": "builtin", 362 | "dependencies": {} 363 | }, 364 | "com.unity.modules.xr": { 365 | "version": "1.0.0", 366 | "depth": 0, 367 | "source": "builtin", 368 | "dependencies": { 369 | "com.unity.modules.physics": "1.0.0", 370 | "com.unity.modules.jsonserialize": "1.0.0", 371 | "com.unity.modules.subsystems": "1.0.0" 372 | } 373 | } 374 | } 375 | } 376 | -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Scripts/DebugMenu.cs: -------------------------------------------------------------------------------- 1 | // ============================================================================= 2 | // MIT License 3 | // 4 | // Copyright (c) 2018 Valeriya Pudova (hww.github.io) 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | // SOFTWARE. 23 | // ============================================================================= 24 | 25 | using System; 26 | using System.Collections.Generic; 27 | using UnityEngine; 28 | 29 | namespace XiDebugMenu 30 | { 31 | public class DebugMenu : DebugMenuItem 32 | { 33 | private const int DEFAULT_CAPACITY = 10; 34 | 35 | // ============================================================================================================= 36 | // Menu lines code 37 | // ============================================================================================================= 38 | 39 | public int currentLine; 40 | public float autoRefreshPeriod; 41 | public int widthOfName; 42 | public int widthOfNameAnValue; 43 | public int widthOfValue; 44 | 45 | private readonly List itemsList; 46 | private Action onClose; 47 | private Action onOpen; 48 | private Action onClear; 49 | private bool doRefresh; 50 | private float doRefreshUpTo; 51 | 52 | // ============================================================================================================= 53 | // Dimensions of menu 54 | // ============================================================================================================= 55 | 56 | public DebugMenu(string path, int order = 0) : base(path, order) 57 | { 58 | itemsList = new List(DEFAULT_CAPACITY); 59 | } 60 | 61 | public DebugMenu(DebugMenu parentMenu, string label, int order = 0) : base(parentMenu, label, order) 62 | { 63 | itemsList = new List(DEFAULT_CAPACITY); 64 | } 65 | 66 | // ============================================================================================================= 67 | // DebugMenu main API 68 | // ============================================================================================================= 69 | 70 | /// 71 | /// Get lines quantity 72 | /// 73 | public int Count => itemsList.Count; 74 | /// 75 | /// Get line by index 76 | /// 77 | /// 78 | public DebugMenuItem this[int idx] => itemsList[idx]; 79 | /// 80 | /// Get current menu item 81 | /// 82 | /// 83 | public DebugMenuItem GetCurrent() 84 | { 85 | if (Count == 0) return null; 86 | if (currentLine >= Count) currentLine = 0; 87 | return itemsList[currentLine]; 88 | } 89 | /// 90 | /// Get root menu of this menu 91 | /// 92 | /// 93 | public DebugMenu GetRootMenu() 94 | { 95 | // TODO! make it non recursive 96 | if (parentMenu == null) 97 | return this; 98 | return parentMenu.GetRootMenu(); 99 | } 100 | /// 101 | /// Find menu item by path 102 | /// 103 | /// 104 | /// 105 | public DebugMenuItem Find(string path) 106 | { 107 | var names = path.Split('/'); 108 | return Find(names); 109 | } 110 | private DebugMenuItem Find(string[] path) 111 | { 112 | var currentMenu = this; 113 | var lastIndex = path.Length - 1; 114 | for (var i = 0; i < path.Length; i++) 115 | { 116 | var itemName = path[i]; 117 | var currentItem = itemsList.Find(item => item.label == itemName); 118 | if (currentItem == null) 119 | return null; 120 | if (i == lastIndex) 121 | return currentItem; 122 | currentMenu = currentItem as DebugMenu; 123 | if (currentMenu == null) 124 | return null; 125 | } 126 | 127 | return currentMenu; 128 | } 129 | /// 130 | /// Add menu item 131 | /// 132 | /// 133 | public void AddItem(DebugMenuItem item) 134 | { 135 | itemsList.Add(item); 136 | itemsList.Sort(CompareItem); 137 | } 138 | /// 139 | /// Remove menu item 140 | /// 141 | /// 142 | public void RemoveItem(DebugMenuItem item) 143 | { 144 | itemsList.Remove(item); 145 | } 146 | /// 147 | /// Clear all items of this menu. Do not modify children. 148 | /// 149 | public void Clear() 150 | { 151 | itemsList.Clear(); 152 | onClear?.Invoke(this); 153 | } 154 | /// 155 | /// Clear all item of this menu and children 156 | /// 157 | public void ClearDownTree() 158 | { 159 | for (var i=0 ;i 166 | /// Return true if menu has to be updated per frame 167 | /// 168 | public bool DoRefresh 169 | { 170 | get => doRefresh || Time.unscaledTime < doRefreshUpTo; 171 | set => doRefresh = value; 172 | } 173 | 174 | /// 175 | /// Request refresh for this menu 176 | /// 177 | public void RequestRefresh() 178 | { 179 | doRefresh = true; 180 | } 181 | 182 | public void RequestRefresh(float duration) 183 | { 184 | doRefreshUpTo = Mathf.Max(Time.unscaledTime + duration); 185 | } 186 | /// 187 | /// Get menu string 188 | /// 189 | /// 190 | public override string ToString() 191 | { 192 | return $"Menu[{label}]"; 193 | } 194 | 195 | // ============================================================================================================= 196 | // Sorting & ordering 197 | // ============================================================================================================= 198 | 199 | public void Sort() 200 | { 201 | itemsList.Sort(CompareItem); 202 | } 203 | 204 | private static int CompareItem(DebugMenuItem x, DebugMenuItem y) 205 | { 206 | Debug.Assert(x != null); 207 | Debug.Assert(y != null); 208 | return x.order.CompareTo(y.order); 209 | } 210 | 211 | // ============================================================================================================= 212 | // Menu find or creation 213 | // ============================================================================================================= 214 | 215 | /// 216 | /// Will return existing or create new menu 217 | /// 218 | /// 219 | /// 220 | /// 221 | /// 222 | public DebugMenu GetOrCreateMenu(string path, int order = 0, int capacity = 10) 223 | { 224 | if (string.IsNullOrEmpty(path)) 225 | return this; 226 | return GetOrCreateMenu(path.Split('/')); 227 | } 228 | 229 | /// 230 | /// Will return existing or create new menu 231 | /// 232 | /// 233 | /// 234 | /// 235 | /// 236 | public DebugMenu GetOrCreateMenu(string[] path, int order = 0, int capacity = 10) 237 | { 238 | var currentMenu = this; 239 | for (var i = 0; i < path.Length; i++) 240 | { 241 | var itemName = path[i]; 242 | var currentItem = currentMenu.itemsList.Find(item => item.label == itemName); 243 | if (currentItem == null) currentItem = new DebugMenu(currentMenu, itemName, order); 244 | var menu = currentItem as DebugMenu; 245 | if (menu == null) 246 | { 247 | Debug.LogError($"Expected menu '{itemName}' in path {path} found {currentItem}"); 248 | return null; 249 | } 250 | 251 | currentMenu = menu; 252 | } 253 | 254 | return currentMenu; 255 | } 256 | 257 | // ============================================================================================================= 258 | // Menu creation 259 | // ============================================================================================================= 260 | 261 | /// 262 | /// Deliver message to all children 263 | /// 264 | /// 265 | public void SendToChildren(EvenTag tag) 266 | { 267 | for (var i = 0; i < itemsList.Count; i++) itemsList[i].OnEvent(tag); 268 | } 269 | 270 | /// 271 | /// Perform actions for events 272 | /// 273 | /// 274 | public override void OnEvent(EvenTag tag) 275 | { 276 | var isVisible = DebugMenuSystem.isVisible; 277 | var currentItem = GetCurrent(); 278 | // do not send message to children, just do only what this instance need 279 | // update color or text 280 | switch (tag) 281 | { 282 | case EvenTag.Right: 283 | 284 | if (currentItem is DebugMenu submenu && isVisible) 285 | { 286 | DebugMenuSystem.OpenMenu(submenu); 287 | } 288 | else 289 | { 290 | currentItem?.OnEvent(tag); 291 | } 292 | return; 293 | case EvenTag.Left: 294 | if (currentItem is DebugMenu && isVisible) 295 | { 296 | DebugMenuSystem.CloseMenu(); 297 | } 298 | else 299 | { 300 | currentItem?.OnEvent(tag); 301 | } 302 | return; 303 | case EvenTag.OpenMenu: 304 | onOpen?.Invoke(this); 305 | return; 306 | case EvenTag.CloseMenu: 307 | onClose?.Invoke(this); 308 | return; 309 | case EvenTag.Up: 310 | if (currentLine > 0) 311 | currentLine--; 312 | currentLine = Math.Min(currentLine, Count - 1); 313 | return; 314 | case EvenTag.Down: 315 | currentLine++; 316 | currentLine = Math.Min(currentLine, Count - 1); 317 | return; 318 | } 319 | } 320 | 321 | // ============================================================================================================= 322 | // Dimensions of menu 323 | // ============================================================================================================= 324 | 325 | /// 326 | /// Calculate menu, name, value columns width 327 | /// 328 | public void UpdateWidth(int space) 329 | { 330 | widthOfName = 0; 331 | widthOfValue = 0; 332 | widthOfNameAnValue = label.Length; // this menu name 333 | 334 | for (var i = 0; i < itemsList.Count; i++) 335 | { 336 | var item = itemsList[i]; 337 | if (item is DebugMenu) 338 | { 339 | widthOfNameAnValue = Math.Max(widthOfNameAnValue, item.label.Length + 3); // 3 for "..." 340 | } 341 | else 342 | { 343 | if (item.label != null && item.value != null) 344 | { 345 | widthOfName = Math.Max(widthOfName, item.label.Length); 346 | widthOfValue = Math.Max(widthOfValue, item.value.Length); 347 | } 348 | else 349 | { 350 | widthOfNameAnValue = Math.Max(widthOfNameAnValue, item.label.Length); 351 | } 352 | } 353 | } 354 | 355 | widthOfNameAnValue = Math.Max(widthOfNameAnValue, widthOfName + widthOfValue + space); 356 | widthOfName = Math.Max(widthOfName, widthOfNameAnValue - widthOfValue - space); 357 | } 358 | 359 | 360 | 361 | // ============================================================================================================= 362 | // Syntax sugar 363 | // ============================================================================================================= 364 | 365 | public DebugMenu OnOpen(Action onOpen) 366 | { 367 | this.onOpen = onOpen; 368 | return this; 369 | } 370 | 371 | public DebugMenu OnClose(Action onClose) 372 | { 373 | this.onClose = onClose; 374 | return this; 375 | } 376 | 377 | public DebugMenu OnClear(Action onClear) 378 | { 379 | this.onClear = onClear; 380 | return this; 381 | } 382 | 383 | public DebugMenu AutoRefresh(float period) 384 | { 385 | autoRefreshPeriod = period; 386 | return this; 387 | } 388 | } 389 | } -------------------------------------------------------------------------------- /Assets/XiDebugMenu/Examples/debug-menu-demo.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 0} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 0 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 10 60 | m_AtlasSize: 512 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 256 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 256 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ExportTrainingData: 0 98 | m_TrainingDataDestination: TrainingData 99 | m_LightProbeSampleCountMultiplier: 4 100 | m_LightingDataAsset: {fileID: 0} 101 | m_LightingSettings: {fileID: 1120911522} 102 | --- !u!196 &4 103 | NavMeshSettings: 104 | serializedVersion: 2 105 | m_ObjectHideFlags: 0 106 | m_BuildSettings: 107 | serializedVersion: 2 108 | agentTypeID: 0 109 | agentRadius: 0.5 110 | agentHeight: 2 111 | agentSlope: 45 112 | agentClimb: 0.4 113 | ledgeDropHeight: 0 114 | maxJumpAcrossDistance: 0 115 | minRegionArea: 2 116 | manualCellSize: 0 117 | cellSize: 0.16666667 118 | manualTileSize: 0 119 | tileSize: 256 120 | accuratePlacement: 0 121 | maxJobWorkers: 0 122 | preserveTilesOutsideBounds: 0 123 | debug: 124 | m_Flags: 0 125 | m_NavMeshData: {fileID: 0} 126 | --- !u!1 &170076733 127 | GameObject: 128 | m_ObjectHideFlags: 0 129 | m_CorrespondingSourceObject: {fileID: 0} 130 | m_PrefabInstance: {fileID: 0} 131 | m_PrefabAsset: {fileID: 0} 132 | serializedVersion: 6 133 | m_Component: 134 | - component: {fileID: 170076735} 135 | - component: {fileID: 170076734} 136 | m_Layer: 0 137 | m_Name: Directional Light 138 | m_TagString: Untagged 139 | m_Icon: {fileID: 0} 140 | m_NavMeshLayer: 0 141 | m_StaticEditorFlags: 0 142 | m_IsActive: 1 143 | --- !u!108 &170076734 144 | Light: 145 | m_ObjectHideFlags: 0 146 | m_CorrespondingSourceObject: {fileID: 0} 147 | m_PrefabInstance: {fileID: 0} 148 | m_PrefabAsset: {fileID: 0} 149 | m_GameObject: {fileID: 170076733} 150 | m_Enabled: 1 151 | serializedVersion: 10 152 | m_Type: 1 153 | m_Shape: 0 154 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 155 | m_Intensity: 1 156 | m_Range: 10 157 | m_SpotAngle: 30 158 | m_InnerSpotAngle: 21.80208 159 | m_CookieSize: 10 160 | m_Shadows: 161 | m_Type: 2 162 | m_Resolution: -1 163 | m_CustomResolution: -1 164 | m_Strength: 1 165 | m_Bias: 0.05 166 | m_NormalBias: 0.4 167 | m_NearPlane: 0.2 168 | m_CullingMatrixOverride: 169 | e00: 1 170 | e01: 0 171 | e02: 0 172 | e03: 0 173 | e10: 0 174 | e11: 1 175 | e12: 0 176 | e13: 0 177 | e20: 0 178 | e21: 0 179 | e22: 1 180 | e23: 0 181 | e30: 0 182 | e31: 0 183 | e32: 0 184 | e33: 1 185 | m_UseCullingMatrixOverride: 0 186 | m_Cookie: {fileID: 0} 187 | m_DrawHalo: 0 188 | m_Flare: {fileID: 0} 189 | m_RenderMode: 0 190 | m_CullingMask: 191 | serializedVersion: 2 192 | m_Bits: 4294967295 193 | m_RenderingLayerMask: 1 194 | m_Lightmapping: 1 195 | m_LightShadowCasterMode: 0 196 | m_AreaSize: {x: 1, y: 1} 197 | m_BounceIntensity: 1 198 | m_ColorTemperature: 6570 199 | m_UseColorTemperature: 0 200 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 201 | m_UseBoundingSphereOverride: 0 202 | m_UseViewFrustumForShadowCasterCull: 1 203 | m_ShadowRadius: 0 204 | m_ShadowAngle: 0 205 | --- !u!4 &170076735 206 | Transform: 207 | m_ObjectHideFlags: 0 208 | m_CorrespondingSourceObject: {fileID: 0} 209 | m_PrefabInstance: {fileID: 0} 210 | m_PrefabAsset: {fileID: 0} 211 | m_GameObject: {fileID: 170076733} 212 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 213 | m_LocalPosition: {x: 0, y: 3, z: 0} 214 | m_LocalScale: {x: 1, y: 1, z: 1} 215 | m_ConstrainProportionsScale: 0 216 | m_Children: [] 217 | m_Father: {fileID: 0} 218 | m_RootOrder: 1 219 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 220 | --- !u!1 &534669902 221 | GameObject: 222 | m_ObjectHideFlags: 0 223 | m_CorrespondingSourceObject: {fileID: 0} 224 | m_PrefabInstance: {fileID: 0} 225 | m_PrefabAsset: {fileID: 0} 226 | serializedVersion: 6 227 | m_Component: 228 | - component: {fileID: 534669905} 229 | - component: {fileID: 534669904} 230 | - component: {fileID: 534669903} 231 | m_Layer: 0 232 | m_Name: Main Camera 233 | m_TagString: Untagged 234 | m_Icon: {fileID: 0} 235 | m_NavMeshLayer: 0 236 | m_StaticEditorFlags: 0 237 | m_IsActive: 1 238 | --- !u!81 &534669903 239 | AudioListener: 240 | m_ObjectHideFlags: 0 241 | m_CorrespondingSourceObject: {fileID: 0} 242 | m_PrefabInstance: {fileID: 0} 243 | m_PrefabAsset: {fileID: 0} 244 | m_GameObject: {fileID: 534669902} 245 | m_Enabled: 1 246 | --- !u!20 &534669904 247 | Camera: 248 | m_ObjectHideFlags: 0 249 | m_CorrespondingSourceObject: {fileID: 0} 250 | m_PrefabInstance: {fileID: 0} 251 | m_PrefabAsset: {fileID: 0} 252 | m_GameObject: {fileID: 534669902} 253 | m_Enabled: 1 254 | serializedVersion: 2 255 | m_ClearFlags: 1 256 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 257 | m_projectionMatrixMode: 1 258 | m_GateFitMode: 2 259 | m_FOVAxisMode: 0 260 | m_SensorSize: {x: 36, y: 24} 261 | m_LensShift: {x: 0, y: 0} 262 | m_FocalLength: 50 263 | m_NormalizedViewPortRect: 264 | serializedVersion: 2 265 | x: 0 266 | y: 0 267 | width: 1 268 | height: 1 269 | near clip plane: 0.3 270 | far clip plane: 1000 271 | field of view: 60 272 | orthographic: 0 273 | orthographic size: 5 274 | m_Depth: -1 275 | m_CullingMask: 276 | serializedVersion: 2 277 | m_Bits: 4294967295 278 | m_RenderingPath: -1 279 | m_TargetTexture: {fileID: 0} 280 | m_TargetDisplay: 0 281 | m_TargetEye: 3 282 | m_HDR: 1 283 | m_AllowMSAA: 1 284 | m_AllowDynamicResolution: 0 285 | m_ForceIntoRT: 0 286 | m_OcclusionCulling: 1 287 | m_StereoConvergence: 10 288 | m_StereoSeparation: 0.022 289 | --- !u!4 &534669905 290 | Transform: 291 | m_ObjectHideFlags: 0 292 | m_CorrespondingSourceObject: {fileID: 0} 293 | m_PrefabInstance: {fileID: 0} 294 | m_PrefabAsset: {fileID: 0} 295 | m_GameObject: {fileID: 534669902} 296 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 297 | m_LocalPosition: {x: 0, y: 1, z: -10} 298 | m_LocalScale: {x: 1, y: 1, z: 1} 299 | m_ConstrainProportionsScale: 0 300 | m_Children: [] 301 | m_Father: {fileID: 0} 302 | m_RootOrder: 0 303 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 304 | --- !u!850595691 &1120911522 305 | LightingSettings: 306 | m_ObjectHideFlags: 0 307 | m_CorrespondingSourceObject: {fileID: 0} 308 | m_PrefabInstance: {fileID: 0} 309 | m_PrefabAsset: {fileID: 0} 310 | m_Name: Settings.lighting 311 | serializedVersion: 4 312 | m_GIWorkflowMode: 0 313 | m_EnableBakedLightmaps: 1 314 | m_EnableRealtimeLightmaps: 0 315 | m_RealtimeEnvironmentLighting: 1 316 | m_BounceScale: 1 317 | m_AlbedoBoost: 1 318 | m_IndirectOutputScale: 1 319 | m_UsingShadowmask: 1 320 | m_BakeBackend: 1 321 | m_LightmapMaxSize: 512 322 | m_BakeResolution: 10 323 | m_Padding: 2 324 | m_LightmapCompression: 3 325 | m_AO: 0 326 | m_AOMaxDistance: 1 327 | m_CompAOExponent: 1 328 | m_CompAOExponentDirect: 0 329 | m_ExtractAO: 0 330 | m_MixedBakeMode: 2 331 | m_LightmapsBakeMode: 1 332 | m_FilterMode: 1 333 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 334 | m_ExportTrainingData: 0 335 | m_TrainingDataDestination: TrainingData 336 | m_RealtimeResolution: 2 337 | m_ForceWhiteAlbedo: 0 338 | m_ForceUpdates: 0 339 | m_FinalGather: 0 340 | m_FinalGatherRayCount: 256 341 | m_FinalGatherFiltering: 1 342 | m_PVRCulling: 1 343 | m_PVRSampling: 1 344 | m_PVRDirectSampleCount: 32 345 | m_PVRSampleCount: 256 346 | m_PVREnvironmentSampleCount: 256 347 | m_PVREnvironmentReferencePointCount: 2048 348 | m_LightProbeSampleCountMultiplier: 4 349 | m_PVRBounces: 2 350 | m_PVRMinBounces: 2 351 | m_PVREnvironmentMIS: 0 352 | m_PVRFilteringMode: 2 353 | m_PVRDenoiserTypeDirect: 0 354 | m_PVRDenoiserTypeIndirect: 0 355 | m_PVRDenoiserTypeAO: 0 356 | m_PVRFilterTypeDirect: 0 357 | m_PVRFilterTypeIndirect: 0 358 | m_PVRFilterTypeAO: 0 359 | m_PVRFilteringGaussRadiusDirect: 1 360 | m_PVRFilteringGaussRadiusIndirect: 5 361 | m_PVRFilteringGaussRadiusAO: 2 362 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 363 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 364 | m_PVRFilteringAtrousPositionSigmaAO: 1 365 | m_PVRTiledBaking: 0 366 | --- !u!1 &1180110477 367 | GameObject: 368 | m_ObjectHideFlags: 0 369 | m_CorrespondingSourceObject: {fileID: 0} 370 | m_PrefabInstance: {fileID: 0} 371 | m_PrefabAsset: {fileID: 0} 372 | serializedVersion: 6 373 | m_Component: 374 | - component: {fileID: 1180110480} 375 | - component: {fileID: 1180110479} 376 | - component: {fileID: 1180110478} 377 | m_Layer: 0 378 | m_Name: EventSystem 379 | m_TagString: Untagged 380 | m_Icon: {fileID: 0} 381 | m_NavMeshLayer: 0 382 | m_StaticEditorFlags: 0 383 | m_IsActive: 1 384 | --- !u!114 &1180110478 385 | MonoBehaviour: 386 | m_ObjectHideFlags: 0 387 | m_CorrespondingSourceObject: {fileID: 0} 388 | m_PrefabInstance: {fileID: 0} 389 | m_PrefabAsset: {fileID: 0} 390 | m_GameObject: {fileID: 1180110477} 391 | m_Enabled: 1 392 | m_EditorHideFlags: 0 393 | m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} 394 | m_Name: 395 | m_EditorClassIdentifier: 396 | m_SendPointerHoverToParent: 1 397 | m_HorizontalAxis: Horizontal 398 | m_VerticalAxis: Vertical 399 | m_SubmitButton: Submit 400 | m_CancelButton: Cancel 401 | m_InputActionsPerSecond: 10 402 | m_RepeatDelay: 0.5 403 | m_ForceModuleActive: 0 404 | --- !u!114 &1180110479 405 | MonoBehaviour: 406 | m_ObjectHideFlags: 0 407 | m_CorrespondingSourceObject: {fileID: 0} 408 | m_PrefabInstance: {fileID: 0} 409 | m_PrefabAsset: {fileID: 0} 410 | m_GameObject: {fileID: 1180110477} 411 | m_Enabled: 1 412 | m_EditorHideFlags: 0 413 | m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} 414 | m_Name: 415 | m_EditorClassIdentifier: 416 | m_FirstSelected: {fileID: 0} 417 | m_sendNavigationEvents: 1 418 | m_DragThreshold: 10 419 | --- !u!4 &1180110480 420 | Transform: 421 | m_ObjectHideFlags: 0 422 | m_CorrespondingSourceObject: {fileID: 0} 423 | m_PrefabInstance: {fileID: 0} 424 | m_PrefabAsset: {fileID: 0} 425 | m_GameObject: {fileID: 1180110477} 426 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 427 | m_LocalPosition: {x: 0, y: 0, z: 0} 428 | m_LocalScale: {x: 1, y: 1, z: 1} 429 | m_ConstrainProportionsScale: 0 430 | m_Children: [] 431 | m_Father: {fileID: 0} 432 | m_RootOrder: 3 433 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 434 | --- !u!1001 &3483494352279981540 435 | PrefabInstance: 436 | m_ObjectHideFlags: 0 437 | serializedVersion: 2 438 | m_Modification: 439 | m_TransformParent: {fileID: 0} 440 | m_Modifications: 441 | - target: {fileID: 1980381131844880016, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 442 | propertyPath: m_AnchorMax.y 443 | value: 0 444 | objectReference: {fileID: 0} 445 | - target: {fileID: 1980381131844880016, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 446 | propertyPath: m_AnchorMin.y 447 | value: 0 448 | objectReference: {fileID: 0} 449 | - target: {fileID: 1980381131844880016, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 450 | propertyPath: m_SizeDelta.x 451 | value: 0 452 | objectReference: {fileID: 0} 453 | - target: {fileID: 1980381131844880016, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 454 | propertyPath: m_SizeDelta.y 455 | value: 0 456 | objectReference: {fileID: 0} 457 | - target: {fileID: 1980381131844880016, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 458 | propertyPath: m_AnchoredPosition.x 459 | value: 0 460 | objectReference: {fileID: 0} 461 | - target: {fileID: 1980381131844880016, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 462 | propertyPath: m_AnchoredPosition.y 463 | value: 0 464 | objectReference: {fileID: 0} 465 | - target: {fileID: 1980381131844880017, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 466 | propertyPath: m_fontAsset 467 | value: 468 | objectReference: {fileID: 11400000, guid: e6d68f0bc23885c42b05b0e29152acc5, type: 2} 469 | - target: {fileID: 1980381131844880017, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 470 | propertyPath: m_sharedMaterial 471 | value: 472 | objectReference: {fileID: 21545206951518306, guid: e6d68f0bc23885c42b05b0e29152acc5, type: 2} 473 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 474 | propertyPath: m_RootOrder 475 | value: 2 476 | objectReference: {fileID: 0} 477 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 478 | propertyPath: m_LocalPosition.x 479 | value: 0 480 | objectReference: {fileID: 0} 481 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 482 | propertyPath: m_LocalPosition.y 483 | value: 0 484 | objectReference: {fileID: 0} 485 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 486 | propertyPath: m_LocalPosition.z 487 | value: 0 488 | objectReference: {fileID: 0} 489 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 490 | propertyPath: m_LocalRotation.w 491 | value: 1 492 | objectReference: {fileID: 0} 493 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 494 | propertyPath: m_LocalRotation.x 495 | value: 0 496 | objectReference: {fileID: 0} 497 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 498 | propertyPath: m_LocalRotation.y 499 | value: 0 500 | objectReference: {fileID: 0} 501 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 502 | propertyPath: m_LocalRotation.z 503 | value: 0 504 | objectReference: {fileID: 0} 505 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 506 | propertyPath: m_LocalEulerAnglesHint.x 507 | value: 0 508 | objectReference: {fileID: 0} 509 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 510 | propertyPath: m_LocalEulerAnglesHint.y 511 | value: 0 512 | objectReference: {fileID: 0} 513 | - target: {fileID: 1980381131986226804, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 514 | propertyPath: m_LocalEulerAnglesHint.z 515 | value: 0 516 | objectReference: {fileID: 0} 517 | - target: {fileID: 1980381131986226809, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 518 | propertyPath: m_Name 519 | value: Demo 520 | objectReference: {fileID: 0} 521 | - target: {fileID: 1980381133282147894, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 522 | propertyPath: m_SizeDelta.x 523 | value: 0 524 | objectReference: {fileID: 0} 525 | - target: {fileID: 1980381133282147894, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 526 | propertyPath: m_SizeDelta.y 527 | value: 0 528 | objectReference: {fileID: 0} 529 | - target: {fileID: 3483494351522928719, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 530 | propertyPath: m_SizeDelta.x 531 | value: 0 532 | objectReference: {fileID: 0} 533 | - target: {fileID: 3483494351522928719, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 534 | propertyPath: m_SizeDelta.y 535 | value: 0 536 | objectReference: {fileID: 0} 537 | - target: {fileID: 3483494352974200261, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 538 | propertyPath: m_AnchorMax.y 539 | value: 0 540 | objectReference: {fileID: 0} 541 | - target: {fileID: 3483494352974200261, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 542 | propertyPath: m_AnchorMin.y 543 | value: 0 544 | objectReference: {fileID: 0} 545 | - target: {fileID: 3483494352974200261, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 546 | propertyPath: m_SizeDelta.x 547 | value: 0 548 | objectReference: {fileID: 0} 549 | - target: {fileID: 3483494352974200261, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 550 | propertyPath: m_SizeDelta.y 551 | value: 0 552 | objectReference: {fileID: 0} 553 | - target: {fileID: 3483494352974200261, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 554 | propertyPath: m_AnchoredPosition.x 555 | value: 0 556 | objectReference: {fileID: 0} 557 | - target: {fileID: 3483494352974200261, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 558 | propertyPath: m_AnchoredPosition.y 559 | value: 0 560 | objectReference: {fileID: 0} 561 | - target: {fileID: 3483494352974200263, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 562 | propertyPath: m_fontAsset 563 | value: 564 | objectReference: {fileID: 11400000, guid: e6d68f0bc23885c42b05b0e29152acc5, type: 2} 565 | - target: {fileID: 3483494352974200263, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 566 | propertyPath: m_sharedMaterial 567 | value: 568 | objectReference: {fileID: 21545206951518306, guid: e6d68f0bc23885c42b05b0e29152acc5, type: 2} 569 | m_RemovedComponents: [] 570 | m_SourcePrefab: {fileID: 100100000, guid: bfcfc9d11484de24db00821f6b04d192, type: 3} 571 | --------------------------------------------------------------------------------