├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ ├── lint.yml │ └── stale.yml ├── UnityRawInput.unitypackage ├── ProjectSettings ├── ProjectVersion.txt ├── ClusterInputManager.asset ├── PresetManager.asset ├── NetworkManager.asset ├── XRSettings.asset ├── TimeManager.asset ├── EditorBuildSettings.asset ├── VFXManager.asset ├── AudioManager.asset ├── TagManager.asset ├── UnityConnectSettings.asset ├── PackageManagerSettings.asset ├── DynamicsManager.asset ├── EditorSettings.asset ├── Physics2DSettings.asset ├── NavMeshAreas.asset ├── GraphicsSettings.asset ├── QualitySettings.asset ├── InputManager.asset └── ProjectSettings.asset ├── Assets ├── UnityRawInput │ ├── Runtime │ │ ├── RawMouseState.cs.meta │ │ ├── Elringus.UnityRawInput.Runtime.asmdef.meta │ │ ├── RawKeyState.cs │ │ ├── HookArgs.cs.meta │ │ ├── HookType.cs.meta │ │ ├── RawInput.cs.meta │ │ ├── RawKey.cs.meta │ │ ├── Win32API.cs.meta │ │ ├── RawKeyState.cs.meta │ │ ├── Elringus.UnityRawInput.Runtime.asmdef │ │ ├── HookType.cs │ │ ├── RawMouseState.cs │ │ ├── Win32API.cs │ │ ├── HookArgs.cs │ │ ├── RawKey.cs │ │ └── RawInput.cs │ ├── package.json.meta │ ├── Runtime.meta │ └── package.json ├── Editor.meta ├── Scenes.meta ├── Scenes │ ├── SampleScene.unity.meta │ └── SampleScene.unity ├── Runtime.meta ├── UnityRawInput.meta ├── Editor │ ├── LogRawInputEditor.cs.meta │ ├── PackageExporter.cs.meta │ ├── LogRawInputEditor.cs │ └── PackageExporter.cs └── Runtime │ ├── LogRawInput.cs.meta │ └── LogRawInput.cs ├── Packages ├── manifest.json └── packages-lock.json ├── LICENSE ├── .gitignore ├── README.md └── .editorconfig /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: elringus 2 | -------------------------------------------------------------------------------- /UnityRawInput.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elringus/unity-raw-input/HEAD/UnityRawInput.unitypackage -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.40f1 2 | m_EditorVersionWithRevision: 2019.4.40f1 (ffc62b691db5) 3 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/RawMouseState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d98a1d9f11b44c84a258162e5ba58630 3 | timeCreated: 1661385339 -------------------------------------------------------------------------------- /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 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 975b83fd6ee53bc4b8fa6a5086fb1ee0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7ea808450fac5a488fdd4ada4f615bf 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dfef410e098ed884fb2b6b3d7222efe9 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 | } -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ide.rider": "3.0.16", 4 | "com.unity.ide.visualstudio": "2.0.16", 5 | "com.unity.ide.vscode": "1.2.5", 6 | "com.unity.test-framework": "1.1.33" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/Elringus.UnityRawInput.Runtime.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02f5354accad1af43a8af5108b59c9f0 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/RawKeyState.cs: -------------------------------------------------------------------------------- 1 | namespace UnityRawInput 2 | { 3 | public enum RawKeyState 4 | { 5 | KeyDown = 0x0100, 6 | KeyUp = 0x0101, 7 | SysKeyDown = 0x0104, 8 | SysKeyUp = 0x0105 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01f1106fe59f2cd449b2fca49c9cb12a 3 | folderAsset: yes 4 | timeCreated: 1523544479 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30f4df60b6e0ac6468b51f19637c7185 3 | timeCreated: 1523544485 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cae0cd9c29b15004d83986e2b4f15100 3 | folderAsset: yes 4 | timeCreated: 1523544503 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/UnityRawInput.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdf80b8f2cc43674d81f6d793014d325 3 | folderAsset: yes 4 | timeCreated: 1523544495 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /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 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: 30f4df60b6e0ac6468b51f19637c7185 11 | -------------------------------------------------------------------------------- /Assets/Editor/LogRawInputEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: df40b0764ce6c074dbe4b267f153d7c5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Editor/PackageExporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d39fdb714e45c404fbbd6d6f500944c4 3 | timeCreated: 1506010554 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /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_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /Assets/Runtime/LogRawInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a71338143f3577c4db1055cda7499a05 3 | timeCreated: 1523546028 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.elringus.unityrawinput", 3 | "version": "1.5.0", 4 | "displayName": "UnityRawInput", 5 | "description": "Windows Raw Input wrapper for Unity game engine.", 6 | "unity": "2019.4", 7 | "author": { 8 | "name": "Elringus", 9 | "url": "https://github.com/Elringus" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/HookArgs.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4ca76881de691f49a47479206843d78 3 | timeCreated: 1523545077 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/HookType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e13b45b5bf98a5a479a5528ca7296885 3 | timeCreated: 1523544788 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/RawInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcd8f9c4d4f787c41a6773c51eb03b56 3 | timeCreated: 1523544586 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/RawKey.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab5effb69bfa2354eb9847a0d456506f 3 | timeCreated: 1523544788 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/Win32API.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a663f4537a2dd714fbf00881f4102f1d 3 | timeCreated: 1523545077 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/RawKeyState.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 74ecfe7350096da4685262398c54a17b 3 | timeCreated: 1523544788 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /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 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: lint 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | 11 | jobs: 12 | lint: 13 | name: lint editorconfig 14 | runs-on: ubuntu-latest 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: editorconfig 18 | run: | 19 | docker run --rm --volume=$PWD:/check mstruebing/editorconfig-checker ec --exclude ".git|\.meta$|\.asset$|\.unity$|\.asmdef$|ProjectSettings" 20 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/Elringus.UnityRawInput.Runtime.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Elringus.UnityRawInput.Runtime", 3 | "references": [], 4 | "includePlatforms": [ 5 | "Editor", 6 | "WindowsStandalone32", 7 | "WindowsStandalone64" 8 | ], 9 | "excludePlatforms": [], 10 | "allowUnsafeCode": false, 11 | "overrideReferences": false, 12 | "precompiledReferences": [], 13 | "autoReferenced": true, 14 | "defineConstraints": [], 15 | "versionDefines": [], 16 | "noEngineReferences": false 17 | } 18 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/HookType.cs: -------------------------------------------------------------------------------- 1 | namespace UnityRawInput 2 | { 3 | public enum HookType 4 | { 5 | WH_JOURNALRECORD = 0, 6 | WH_JOURNALPLAYBACK = 1, 7 | WH_KEYBOARD = 2, 8 | WH_GETMESSAGE = 3, 9 | WH_CALLWNDPROC = 4, 10 | WH_CBT = 5, 11 | WH_SYSMSGFILTER = 6, 12 | WH_MOUSE = 7, 13 | WH_HARDWARE = 8, 14 | WH_DEBUG = 9, 15 | WH_SHELL = 10, 16 | WH_FOREGROUNDIDLE = 11, 17 | WH_CALLWNDPROCRET = 12, 18 | WH_KEYBOARD_LL = 13, 19 | WH_MOUSE_LL = 14 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /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/UnityRawInput/Runtime/RawMouseState.cs: -------------------------------------------------------------------------------- 1 | namespace UnityRawInput 2 | { 3 | public enum RawMouseState : ushort 4 | { 5 | MouseMove = 0x0200, 6 | LeftButtonDown = 0x0201, 7 | LeftButtonUp = 0x0202, 8 | LeftButtonDoubleClick = 0x0203, 9 | RightButtonDown = 0x0204, 10 | RightButtonUp = 0x0205, 11 | RightButtonDoubleClick = 0x0206, 12 | MiddleButtonDown = 0x0207, 13 | MiddleButtonUp = 0x0208, 14 | MiddleButtonDoubleClick = 0x0209, 15 | MouseWheel = 0x020A, 16 | ExtraButtonDown = 0x20B, 17 | ExtraButtonUp = 0x20C, 18 | ExtraButtonDoubleClick = 0x20D, 19 | MouseWheelHorizontal = 0x20E 20 | } 21 | 22 | // https://www.pinvoke.net/default.aspx/Constants/WM.html 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- 1 | name: close stale issues 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '45 3 * * *' 7 | 8 | jobs: 9 | stale: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/stale@v4 13 | id: stale 14 | with: 15 | stale-issue-label: stale 16 | stale-pr-label: stale 17 | stale-issue-message: 'This issue is stale because it has been open 14 days with no activity. It will be automatically closed in 7 days.' 18 | stale-pr-message: 'This pull request is stale because it has been open 14 days with no activity. It will be automatically closed in 7 days.' 19 | days-before-stale: 14 20 | days-before-close: 7 21 | exempt-issue-labels: 'bug,enhancement' 22 | exempt-pr-labels: 'bug,enhancement' 23 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/Win32API.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace UnityRawInput 5 | { 6 | public static class Win32API 7 | { 8 | public delegate int HookProc (int code, IntPtr wParam, IntPtr lParam); 9 | 10 | [DllImport("User32")] 11 | public static extern IntPtr SetWindowsHookEx (HookType code, HookProc func, IntPtr hInstance, int threadID); 12 | [DllImport("User32")] 13 | public static extern int UnhookWindowsHookEx (IntPtr hhook); 14 | [DllImport("User32")] 15 | public static extern int CallNextHookEx (IntPtr hhook, int code, IntPtr wParam, IntPtr lParam); 16 | [DllImport("Kernel32")] 17 | public static extern uint GetCurrentThreadId (); 18 | [DllImport("Kernel32")] 19 | public static extern IntPtr GetModuleHandle (string lpModuleName); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Assets/Editor/LogRawInputEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityRawInput; 3 | 4 | [CustomEditor(typeof(LogRawInput))] 5 | public class LogRawInputEditor : Editor 6 | { 7 | public override void OnInspectorGUI () 8 | { 9 | base.OnInspectorGUI(); 10 | EditorGUILayout.LabelField("Pressed Keys", GetKeys()); 11 | EditorGUILayout.HelpBox("Press Esc to disable intercept in play mode.", MessageType.Info); 12 | } 13 | 14 | private void OnEnable () 15 | { 16 | RawInput.OnKeyDown += HandleKeyEvent; 17 | RawInput.OnKeyUp += HandleKeyEvent; 18 | } 19 | 20 | private void OnDisable () 21 | { 22 | RawInput.OnKeyDown -= HandleKeyEvent; 23 | RawInput.OnKeyUp -= HandleKeyEvent; 24 | } 25 | 26 | private void HandleKeyEvent (RawKey _) 27 | { 28 | Repaint(); 29 | } 30 | 31 | private string GetKeys () 32 | { 33 | return string.Join(" + ", RawInput.PressedKeys); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 0 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 0 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /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_ScopedRegistriesSettingsExpanded: 1 16 | oneTimeWarningShown: 0 17 | m_Registries: 18 | - m_Id: main 19 | m_Name: 20 | m_Url: https://packages.unity.com 21 | m_Scopes: [] 22 | m_IsDefault: 1 23 | m_UserSelectedRegistryName: 24 | m_UserAddingNewScopedRegistry: 0 25 | m_RegistryInfoDraft: 26 | m_ErrorMessage: 27 | m_Original: 28 | m_Id: 29 | m_Name: 30 | m_Url: 31 | m_Scopes: [] 32 | m_IsDefault: 0 33 | m_Modified: 0 34 | m_Name: 35 | m_Url: 36 | m_Scopes: 37 | - 38 | m_SelectedScopeIndex: 0 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Artyom Sovetnikov (Elringus) 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 | -------------------------------------------------------------------------------- /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: 7 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: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /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: 9 7 | m_ExternalVersionControlSupport: Hidden Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 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: 1 27 | m_EnterPlayModeOptions: 3 28 | m_ShowLightmapResolutionOverlay: 1 29 | m_UseLegacyProbeSampleCount: 1 30 | m_AssetPipelineMode: 1 31 | m_CacheServerMode: 0 32 | m_CacheServerEndpoint: 33 | m_CacheServerNamespacePrefix: default 34 | m_CacheServerEnableDownload: 1 35 | m_CacheServerEnableUpload: 1 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /[Uu]ser[Ss]ettings/ 7 | /[Cc]ode[Cc]overage/ 8 | /[Ll]ogs/ 9 | 10 | # Autogenerated VS/MD solution and project files 11 | .vs/ 12 | .vscode/ 13 | ExportedObj/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.idea/ 25 | 26 | # Unity3D generated meta files 27 | *.pidb.meta 28 | 29 | # Unity3D Generated File On Crash Reports 30 | sysinfo.txt 31 | 32 | # Builds 33 | *.apk 34 | 35 | # ========================= 36 | # Operating System Files 37 | # ========================= 38 | 39 | # OSX 40 | # ========================= 41 | 42 | .DS_Store 43 | .AppleDouble 44 | .LSOverride 45 | 46 | # Thumbnails 47 | ._* 48 | 49 | # Files that might appear in the root of a volume 50 | .DocumentRevisions-V100 51 | .fseventsd 52 | .Spotlight-V100 53 | .TemporaryItems 54 | .Trashes 55 | .VolumeIcon.icns 56 | 57 | # Directories potentially created on remote AFP share 58 | .AppleDB 59 | .AppleDesktop 60 | Network Trash Folder 61 | Temporary Items 62 | .apdisk 63 | 64 | # Windows 65 | # ========================= 66 | 67 | # Windows image file caches 68 | Thumbs.db 69 | ehthumbs.db 70 | 71 | # Folder config file 72 | Desktop.ini 73 | 74 | # Recycle Bin used on file shares 75 | $RECYCLE.BIN/ 76 | 77 | # Windows Installer files 78 | *.cab 79 | *.msi 80 | *.msm 81 | *.msp 82 | 83 | # Windows shortcuts 84 | *.lnk 85 | -------------------------------------------------------------------------------- /Assets/Runtime/LogRawInput.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityRawInput; 3 | 4 | public class LogRawInput : MonoBehaviour 5 | { 6 | public bool WorkInBackground; 7 | public bool InterceptMessages; 8 | 9 | private void OnEnable () 10 | { 11 | RawInput.WorkInBackground = WorkInBackground; 12 | RawInput.InterceptMessages = InterceptMessages; 13 | 14 | RawInput.OnKeyUp += LogKeyUp; 15 | RawInput.OnKeyDown += LogKeyDown; 16 | RawInput.OnKeyDown += DisableIntercept; 17 | 18 | RawInput.Start(); 19 | } 20 | 21 | private void OnDisable () 22 | { 23 | RawInput.Stop(); 24 | 25 | RawInput.OnKeyUp -= LogKeyUp; 26 | RawInput.OnKeyDown -= LogKeyDown; 27 | RawInput.OnKeyDown -= DisableIntercept; 28 | } 29 | 30 | private void OnValidate () 31 | { 32 | // Apply options when toggles are clicked in editor. 33 | // OnValidate is invoked only in the editor (won't affect build). 34 | RawInput.InterceptMessages = InterceptMessages; 35 | RawInput.WorkInBackground = WorkInBackground; 36 | } 37 | 38 | private void LogKeyUp (RawKey key) 39 | { 40 | Debug.Log("Key Up: " + key); 41 | } 42 | 43 | private void LogKeyDown (RawKey key) 44 | { 45 | Debug.Log("Key Down: " + key); 46 | } 47 | 48 | private void DisableIntercept (RawKey key) 49 | { 50 | if (RawInput.InterceptMessages && key == RawKey.Escape) 51 | RawInput.InterceptMessages = InterceptMessages = false; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /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: 3 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_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /Packages/packages-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ext.nunit": { 4 | "version": "1.0.6", 5 | "depth": 1, 6 | "source": "registry", 7 | "dependencies": {}, 8 | "url": "https://packages.unity.com" 9 | }, 10 | "com.unity.ide.rider": { 11 | "version": "3.0.16", 12 | "depth": 0, 13 | "source": "registry", 14 | "dependencies": { 15 | "com.unity.ext.nunit": "1.0.6" 16 | }, 17 | "url": "https://packages.unity.com" 18 | }, 19 | "com.unity.ide.visualstudio": { 20 | "version": "2.0.16", 21 | "depth": 0, 22 | "source": "registry", 23 | "dependencies": { 24 | "com.unity.test-framework": "1.1.9" 25 | }, 26 | "url": "https://packages.unity.com" 27 | }, 28 | "com.unity.ide.vscode": { 29 | "version": "1.2.5", 30 | "depth": 0, 31 | "source": "registry", 32 | "dependencies": {}, 33 | "url": "https://packages.unity.com" 34 | }, 35 | "com.unity.test-framework": { 36 | "version": "1.1.33", 37 | "depth": 0, 38 | "source": "registry", 39 | "dependencies": { 40 | "com.unity.ext.nunit": "1.0.6", 41 | "com.unity.modules.imgui": "1.0.0", 42 | "com.unity.modules.jsonserialize": "1.0.0" 43 | }, 44 | "url": "https://packages.unity.com" 45 | }, 46 | "com.unity.modules.imgui": { 47 | "version": "1.0.0", 48 | "depth": 1, 49 | "source": "builtin", 50 | "dependencies": {} 51 | }, 52 | "com.unity.modules.jsonserialize": { 53 | "version": "1.0.0", 54 | "depth": 1, 55 | "source": "builtin", 56 | "dependencies": {} 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/HookArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using UnityEngine; 5 | 6 | namespace UnityRawInput 7 | { 8 | [StructLayout(LayoutKind.Sequential)] 9 | public struct KeyboardArgs 10 | { 11 | public uint Code; 12 | public uint ScanCode; 13 | public KeyboardFlags Flags; 14 | public uint Time; 15 | public UIntPtr ExtraInfo; 16 | 17 | public uint TrueScanCode => Flags.HasFlag(KeyboardFlags.Extended) ? ScanCode + 0x100 : ScanCode; 18 | public uint Advanced => TrueScanCode << 8; 19 | public uint Hybrid => Code + Advanced; 20 | 21 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 22 | public static explicit operator KeyboardArgs (IntPtr ptr) 23 | => Marshal.PtrToStructure(ptr); 24 | 25 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 26 | public static explicit operator RawKey (KeyboardArgs args) 27 | { 28 | if (Enum.IsDefined(typeof(RawKey), args.Code)) 29 | return (RawKey)args.Code; 30 | if (Enum.IsDefined(typeof(RawKey), args.Advanced)) 31 | return (RawKey)args.Advanced; 32 | if (Enum.IsDefined(typeof(RawKey), args.Hybrid)) 33 | return (RawKey)args.Hybrid; 34 | return (RawKey)args.Code; 35 | } 36 | } 37 | 38 | [Flags] 39 | public enum KeyboardFlags : uint 40 | { 41 | Extended = 0x01, 42 | LowerInjected = 0x02, 43 | Injected = 0x10, 44 | AltDown = 0x20, 45 | Up = 0x80 46 | } 47 | 48 | [StructLayout(LayoutKind.Sequential)] 49 | public struct MouseArgs 50 | { 51 | public Vector2Int Point; 52 | public uint MouseData; 53 | public MouseFlags Flags; 54 | public uint Time; 55 | public UIntPtr ExtraInfo; 56 | 57 | [MethodImpl(MethodImplOptions.AggressiveInlining)] 58 | public static explicit operator MouseArgs (IntPtr ptr) 59 | => Marshal.PtrToStructure(ptr); 60 | } 61 | 62 | [Flags] 63 | public enum MouseFlags : uint 64 | { 65 | Injected = 0x01, 66 | LowerInjected = 0x02 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /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: 12 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 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 42 | type: 0} 43 | m_CustomRenderPipeline: {fileID: 0} 44 | m_TransparencySortMode: 0 45 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 46 | m_DefaultRenderingPath: 1 47 | m_DefaultMobileRenderingPath: 1 48 | m_TierSettings: [] 49 | m_LightmapStripping: 0 50 | m_FogStripping: 0 51 | m_InstancingStripping: 0 52 | m_LightmapKeepPlain: 1 53 | m_LightmapKeepDirCombined: 1 54 | m_LightmapKeepDynamicPlain: 1 55 | m_LightmapKeepDynamicDirCombined: 1 56 | m_LightmapKeepShadowMask: 1 57 | m_LightmapKeepSubtractive: 1 58 | m_FogKeepLinear: 1 59 | m_FogKeepExp: 1 60 | m_FogKeepExp2: 1 61 | m_AlbedoSwatchInfos: [] 62 | m_LightsUseLinearIntensity: 0 63 | m_LightsUseColorTemperature: 0 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Wrapper over [Windows Raw Input API](https://msdn.microsoft.com/en-us/library/windows/desktop/ms645536(v=vs.85).aspx) to hook for the native input events. Allows receiving input events even when the Unity application is in background (not in focus). 4 | 5 | Will only work on Windows platform. 6 | 7 | Only keyboard and mouse input is detected. 8 | 9 | ## Installation 10 | 11 | Download and import the package: [UnityRawInput.unitypackage](https://github.com/elringus/unity-raw-input/raw/main/UnityRawInput.unitypackage). 12 | 13 | ## Usage 14 | 15 | Enable `Run In Background` in project's player settings; if not enabled, expect severe mouse slowdown when the application is not in focus https://github.com/elringus/unity-raw-input/issues/19#issuecomment-1227462101. 16 | 17 | ![](https://i.gyazo.com/9737f66dafa9c705601521b82f40fc5a.png) 18 | 19 | Initialize the service to start processing input messages: 20 | 21 | ```csharp 22 | RawInput.Start(); 23 | ``` 24 | 25 | Optionally, configure whether input messages should be handled when the application is not in focus and whether handled messages should be intercepted (both disabled by default): 26 | 27 | ```csharp 28 | RawInput.WorkInBackground = true; 29 | RawInput.InterceptMessages = false; 30 | ``` 31 | 32 | Add listeners to handle input events: 33 | 34 | ```csharp 35 | RawInput.OnKeyUp += HandleKeyUp; 36 | RawInput.OnKeyDown += HandleKeyDown; 37 | 38 | private void HandleKeyUp (RawKey key) { ... } 39 | private void HandleKeyDown (RawKey key) { ... } 40 | ``` 41 | 42 | Check whether specific key is currently pressed: 43 | 44 | ```csharp 45 | if (RawInput.IsKeyDown(key)) { ... } 46 | ``` 47 | 48 | Stop the service: 49 | 50 | ```csharp 51 | RawInput.Stop(); 52 | ``` 53 | 54 | Don't forget to remove listeners when you no longer need them: 55 | 56 | ```csharp 57 | private void OnDisable () 58 | { 59 | RawInput.OnKeyUp -= HandleKeyUp; 60 | RawInput.OnKeyDown -= HandleKeyDown; 61 | } 62 | ``` 63 | 64 | Find usage example in the project: https://github.com/elringus/unity-raw-input/blob/main/Assets/Runtime/LogRawInput.cs. 65 | 66 | List of the raw keys with descriptions: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes. 67 | 68 | --- 69 | 70 | 71 |

The plugin is used in Naninovel: Visual Novel, Dialogue & Cutscene Storytelling Engine. Check it out!

72 |

naninovel banner

73 |
74 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | indent_style = space 9 | tab_width = 4 10 | 11 | csharp_new_line_before_members_in_object_initializers = false 12 | csharp_new_line_before_open_brace = accessors, control_blocks, events, indexers, local_functions, methods, properties, types 13 | csharp_preferred_modifier_order = public, private, protected, internal, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async 14 | csharp_space_between_method_declaration_name_and_open_parenthesis = true 15 | csharp_style_var_elsewhere = true 16 | csharp_style_var_when_type_is_apparent = true 17 | dotnet_naming_rule.private_constants_rule.severity = none 18 | dotnet_naming_rule.private_constants_rule.style = lower_camel_case_style 19 | dotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols 20 | dotnet_naming_rule.private_instance_fields_rule.severity = none 21 | dotnet_naming_rule.private_instance_fields_rule.style = lower_camel_case_style 22 | dotnet_naming_rule.private_instance_fields_rule.symbols = private_instance_fields_symbols 23 | dotnet_naming_rule.private_static_fields_rule.severity = none 24 | dotnet_naming_rule.private_static_fields_rule.style = lower_camel_case_style 25 | dotnet_naming_rule.private_static_fields_rule.symbols = private_static_fields_symbols 26 | dotnet_naming_rule.private_static_readonly_rule.severity = none 27 | dotnet_naming_rule.private_static_readonly_rule.style = lower_camel_case_style 28 | dotnet_naming_rule.private_static_readonly_rule.symbols = private_static_readonly_symbols 29 | dotnet_naming_rule.property_rule.severity = none 30 | dotnet_naming_rule.property_rule.style = upper_camel_case_style 31 | dotnet_naming_rule.property_rule.symbols = property_symbols 32 | dotnet_naming_style.lower_camel_case_style.capitalization = camel_case 33 | dotnet_naming_style.upper_camel_case_style.capitalization = pascal_case 34 | dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private 35 | dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field 36 | dotnet_naming_symbols.private_constants_symbols.required_modifiers = const 37 | dotnet_naming_symbols.private_instance_fields_symbols.applicable_accessibilities = private 38 | dotnet_naming_symbols.private_instance_fields_symbols.applicable_kinds = field 39 | dotnet_naming_symbols.private_static_fields_symbols.applicable_accessibilities = private 40 | dotnet_naming_symbols.private_static_fields_symbols.applicable_kinds = field 41 | dotnet_naming_symbols.private_static_fields_symbols.required_modifiers = static 42 | dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private 43 | dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field 44 | dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static, readonly 45 | dotnet_naming_symbols.property_symbols.applicable_accessibilities = * 46 | dotnet_naming_symbols.property_symbols.applicable_kinds = property 47 | dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none 48 | dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none 49 | dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none 50 | dotnet_style_predefined_type_for_locals_parameters_members = true 51 | dotnet_style_predefined_type_for_member_access = true 52 | dotnet_style_qualification_for_event = false 53 | dotnet_style_qualification_for_field = false 54 | dotnet_style_qualification_for_method = false 55 | dotnet_style_qualification_for_property = false 56 | dotnet_style_require_accessibility_modifiers = for_non_interface_members 57 | -------------------------------------------------------------------------------- /Assets/Scenes/SampleScene.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.37311953, g: 0.38074014, b: 0.3587274, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 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: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 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: 0 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 500 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_UseShadowmask: 1 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 | debug: 122 | m_Flags: 0 123 | m_NavMeshData: {fileID: 0} 124 | --- !u!1 &394699776 125 | GameObject: 126 | m_ObjectHideFlags: 0 127 | m_CorrespondingSourceObject: {fileID: 0} 128 | m_PrefabInstance: {fileID: 0} 129 | m_PrefabAsset: {fileID: 0} 130 | serializedVersion: 6 131 | m_Component: 132 | - component: {fileID: 394699777} 133 | - component: {fileID: 394699778} 134 | m_Layer: 0 135 | m_Name: LogRawInput 136 | m_TagString: Untagged 137 | m_Icon: {fileID: 0} 138 | m_NavMeshLayer: 0 139 | m_StaticEditorFlags: 0 140 | m_IsActive: 1 141 | --- !u!4 &394699777 142 | Transform: 143 | m_ObjectHideFlags: 0 144 | m_CorrespondingSourceObject: {fileID: 0} 145 | m_PrefabInstance: {fileID: 0} 146 | m_PrefabAsset: {fileID: 0} 147 | m_GameObject: {fileID: 394699776} 148 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 149 | m_LocalPosition: {x: 0, y: 0, z: 0} 150 | m_LocalScale: {x: 1, y: 1, z: 1} 151 | m_Children: [] 152 | m_Father: {fileID: 0} 153 | m_RootOrder: 0 154 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 155 | --- !u!114 &394699778 156 | MonoBehaviour: 157 | m_ObjectHideFlags: 0 158 | m_CorrespondingSourceObject: {fileID: 0} 159 | m_PrefabInstance: {fileID: 0} 160 | m_PrefabAsset: {fileID: 0} 161 | m_GameObject: {fileID: 394699776} 162 | m_Enabled: 1 163 | m_EditorHideFlags: 0 164 | m_Script: {fileID: 11500000, guid: a71338143f3577c4db1055cda7499a05, type: 3} 165 | m_Name: 166 | m_EditorClassIdentifier: 167 | WorkInBackground: 1 168 | InterceptMessages: 0 169 | -------------------------------------------------------------------------------- /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 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 0 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 70 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 2 136 | antiAliasing: 2 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 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: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSM: 5 183 | PSP2: 2 184 | Standalone: 5 185 | Tizen: 2 186 | WebGL: 3 187 | WiiU: 5 188 | Windows Store Apps: 5 189 | XboxOne: 5 190 | iPhone: 2 191 | tvOS: 2 192 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/RawKey.cs: -------------------------------------------------------------------------------- 1 | namespace UnityRawInput 2 | { 3 | public enum RawKey : uint 4 | { 5 | // Simple (virtual key) 6 | LeftButton = 0x01, 7 | RightButton = 0x02, 8 | Cancel = 0x03, 9 | MiddleButton = 0x04, 10 | ExtraButton1 = 0x05, 11 | ExtraButton2 = 0x06, 12 | Back = 0x08, 13 | Tab = 0x09, 14 | Clear = 0x0C, 15 | Return = 0x0D, 16 | Shift = 0x10, 17 | Control = 0x11, 18 | Menu = 0x12, 19 | Pause = 0x13, 20 | CapsLock = 0x14, 21 | Kana = 0x15, 22 | Hangeul = 0x15, 23 | Hangul = 0x15, 24 | Junja = 0x17, 25 | Final = 0x18, 26 | Hanja = 0x19, 27 | Kanji = 0x19, 28 | Escape = 0x1B, 29 | Convert = 0x1C, 30 | NonConvert = 0x1D, 31 | Accept = 0x1E, 32 | ModeChange = 0x1F, 33 | Space = 0x20, 34 | Prior = 0x21, 35 | Next = 0x22, 36 | End = 0x23, 37 | Home = 0x24, 38 | Left = 0x25, 39 | Up = 0x26, 40 | Right = 0x27, 41 | Down = 0x28, 42 | Select = 0x29, 43 | Print = 0x2A, 44 | Execute = 0x2B, 45 | Snapshot = 0x2C, 46 | Insert = 0x2D, 47 | Delete = 0x2E, 48 | Help = 0x2F, 49 | N0 = 0x30, 50 | N1 = 0x31, 51 | N2 = 0x32, 52 | N3 = 0x33, 53 | N4 = 0x34, 54 | N5 = 0x35, 55 | N6 = 0x36, 56 | N7 = 0x37, 57 | N8 = 0x38, 58 | N9 = 0x39, 59 | A = 0x41, 60 | B = 0x42, 61 | C = 0x43, 62 | D = 0x44, 63 | E = 0x45, 64 | F = 0x46, 65 | G = 0x47, 66 | H = 0x48, 67 | I = 0x49, 68 | J = 0x4A, 69 | K = 0x4B, 70 | L = 0x4C, 71 | M = 0x4D, 72 | N = 0x4E, 73 | O = 0x4F, 74 | P = 0x50, 75 | Q = 0x51, 76 | R = 0x52, 77 | S = 0x53, 78 | T = 0x54, 79 | U = 0x55, 80 | V = 0x56, 81 | W = 0x57, 82 | X = 0x58, 83 | Y = 0x59, 84 | Z = 0x5A, 85 | LeftWindows = 0x5B, 86 | RightWindows = 0x5C, 87 | Application = 0x5D, 88 | Sleep = 0x5F, 89 | Numpad0 = 0x60, 90 | Numpad1 = 0x61, 91 | Numpad2 = 0x62, 92 | Numpad3 = 0x63, 93 | Numpad4 = 0x64, 94 | Numpad5 = 0x65, 95 | Numpad6 = 0x66, 96 | Numpad7 = 0x67, 97 | Numpad8 = 0x68, 98 | Numpad9 = 0x69, 99 | Multiply = 0x6A, 100 | Add = 0x6B, 101 | Separator = 0x6C, 102 | Subtract = 0x6D, 103 | Decimal = 0x6E, 104 | Divide = 0x6F, 105 | F1 = 0x70, 106 | F2 = 0x71, 107 | F3 = 0x72, 108 | F4 = 0x73, 109 | F5 = 0x74, 110 | F6 = 0x75, 111 | F7 = 0x76, 112 | F8 = 0x77, 113 | F9 = 0x78, 114 | F10 = 0x79, 115 | F11 = 0x7A, 116 | F12 = 0x7B, 117 | F13 = 0x7C, 118 | F14 = 0x7D, 119 | F15 = 0x7E, 120 | F16 = 0x7F, 121 | F17 = 0x80, 122 | F18 = 0x81, 123 | F19 = 0x82, 124 | F20 = 0x83, 125 | F21 = 0x84, 126 | F22 = 0x85, 127 | F23 = 0x86, 128 | F24 = 0x87, 129 | NumLock = 0x90, 130 | ScrollLock = 0x91, 131 | NEC_Equal = 0x92, 132 | Fujitsu_Jisho = 0x92, 133 | Fujitsu_Masshou = 0x93, 134 | Fujitsu_Touroku = 0x94, 135 | Fujitsu_Loya = 0x95, 136 | Fujitsu_Roya = 0x96, 137 | LeftButtonAlt = 0x9A, 138 | RightButtonAlt = 0x9B, 139 | WheelLeft = 0x9C, 140 | WheelRight = 0x9D, 141 | WheelDown = 0x9E, 142 | WheelUp = 0x9F, 143 | LeftShift = 0xA0, 144 | RightShift = 0xA1, 145 | LeftControl = 0xA2, 146 | RightControl = 0xA3, 147 | LeftMenu = 0xA4, 148 | RightMenu = 0xA5, 149 | BrowserBack = 0xA6, 150 | BrowserForward = 0xA7, 151 | BrowserRefresh = 0xA8, 152 | BrowserStop = 0xA9, 153 | BrowserSearch = 0xAA, 154 | BrowserFavorites = 0xAB, 155 | BrowserHome = 0xAC, 156 | VolumeMute = 0xAD, 157 | VolumeDown = 0xAE, 158 | VolumeUp = 0xAF, 159 | MediaNextTrack = 0xB0, 160 | MediaPrevTrack = 0xB1, 161 | MediaStop = 0xB2, 162 | MediaPlayPause = 0xB3, 163 | LaunchMail = 0xB4, 164 | LaunchMediaSelect = 0xB5, 165 | LaunchApplication1 = 0xB6, 166 | LaunchApplication2 = 0xB7, 167 | OEM1 = 0xBA, 168 | OEMPlus = 0xBB, 169 | OEMComma = 0xBC, 170 | OEMMinus = 0xBD, 171 | OEMPeriod = 0xBE, 172 | OEM2 = 0xBF, 173 | OEM3 = 0xC0, 174 | International1 = 0xC1, 175 | BrazilianComma = 0xC2, 176 | OEM4 = 0xDB, 177 | OEM5 = 0xDC, 178 | OEM6 = 0xDD, 179 | OEM7 = 0xDE, 180 | OEM8 = 0xDF, 181 | OEMAX = 0xE1, 182 | OEM102 = 0xE2, 183 | ICOHelp = 0xE3, 184 | ICO00 = 0xE4, 185 | ProcessKey = 0xE5, 186 | ICOClear = 0xE6, 187 | Packet = 0xE7, 188 | OEMReset = 0xE9, 189 | OEMJump = 0xEA, 190 | International5 = 0xEB, 191 | OEMPA1 = 0xEB, 192 | OEMPA2 = 0xEC, 193 | OEMPA3 = 0xED, 194 | OEMWSCtrl = 0xEE, 195 | OEMCUSel = 0xEF, 196 | OEMATTN = 0xF0, 197 | OEMFinish = 0xF1, 198 | OEMCopy = 0xF2, 199 | OEMAuto = 0xF3, 200 | OEMENLW = 0xF4, 201 | OEMBackTab = 0xF5, 202 | ATTN = 0xF6, 203 | CRSel = 0xF7, 204 | EXSel = 0xF8, 205 | EREOF = 0xF9, 206 | Play = 0xFA, 207 | Zoom = 0xFB, 208 | Noname = 0xFC, 209 | PA1 = 0xFD, 210 | OEMClear = 0xFE, 211 | 212 | // Advanced (scan code) 213 | International2 = 0x070 << 8, 214 | International4 = 0x079 << 8, 215 | International3 = 0x07D << 8 216 | } 217 | 218 | // https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes 219 | } 220 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/UnityRawInput/Runtime/RawInput.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using AOT; 4 | using UnityEngine; 5 | 6 | namespace UnityRawInput 7 | { 8 | public static class RawInput 9 | { 10 | /// 11 | /// Event invoked when user presses a key. 12 | /// 13 | public static event Action OnKeyDown; 14 | /// 15 | /// Event invoked when user releases a key. 16 | /// 17 | public static event Action OnKeyUp; 18 | 19 | /// 20 | /// Whether the service is running and input messages are being processed. 21 | /// 22 | public static bool IsRunning => hooks.Count > 0; 23 | /// 24 | /// Whether any key is currently pressed. 25 | /// 26 | public static bool AnyKeyDown => pressedKeys.Count > 0; 27 | /// 28 | /// Whether input messages should be handled when the application is not in focus. 29 | /// 30 | public static bool WorkInBackground { get; set; } 31 | /// 32 | /// Whether handled input messages should not be propagated further. 33 | /// 34 | public static bool InterceptMessages { get; set; } 35 | /// 36 | /// Currently pressed keys. 37 | /// 38 | public static IReadOnlyCollection PressedKeys => pressedKeys; 39 | 40 | private static readonly HashSet pressedKeys = new HashSet(); 41 | private static readonly List hooks = new List(); 42 | 43 | /// 44 | /// Initializes the service and starts processing input messages. 45 | /// 46 | /// Whether the service started successfully. 47 | public static bool Start () 48 | { 49 | if (IsRunning) return false; 50 | EnsureRunInBackgroundEnabled(); 51 | SetHooks(); 52 | return hooks.TrueForAll(h => h != IntPtr.Zero); 53 | } 54 | 55 | /// 56 | /// Terminates the service and stops processing input messages. 57 | /// 58 | public static void Stop () 59 | { 60 | RemoveHooks(); 61 | pressedKeys.Clear(); 62 | } 63 | 64 | /// 65 | /// Checks whether provided key is currently pressed. 66 | /// 67 | public static bool IsKeyDown (RawKey key) 68 | { 69 | return pressedKeys.Contains(key); 70 | } 71 | 72 | private static void SetHooks () 73 | { 74 | hooks.Add(Win32API.SetWindowsHookEx(HookType.WH_KEYBOARD_LL, HandleKeyboardProc, IntPtr.Zero, 0)); 75 | hooks.Add(Win32API.SetWindowsHookEx(HookType.WH_MOUSE_LL, HandleMouseProc, IntPtr.Zero, 0)); 76 | } 77 | 78 | private static void RemoveHooks () 79 | { 80 | foreach (var pointer in hooks) 81 | if (pointer != IntPtr.Zero) 82 | Win32API.UnhookWindowsHookEx(pointer); 83 | hooks.Clear(); 84 | } 85 | 86 | [MonoPInvokeCallback(typeof(Win32API.HookProc))] 87 | private static int HandleKeyboardProc (int code, IntPtr wParam, IntPtr lParam) 88 | { 89 | if (code < 0 || !CanHandleHook()) return Win32API.CallNextHookEx(IntPtr.Zero, code, wParam, lParam); 90 | 91 | var args = (KeyboardArgs)lParam; 92 | var state = (RawKeyState)wParam; 93 | var key = (RawKey)args; 94 | 95 | if (state == RawKeyState.KeyDown || state == RawKeyState.SysKeyDown) HandleKeyDown(key); 96 | else HandleKeyUp(key); 97 | 98 | return InterceptMessages ? 1 : Win32API.CallNextHookEx(IntPtr.Zero, 0, wParam, lParam); 99 | } 100 | 101 | [MonoPInvokeCallback(typeof(Win32API.HookProc))] 102 | private static int HandleMouseProc (int code, IntPtr wParam, IntPtr lParam) 103 | { 104 | if (code < 0 || !CanHandleHook()) return Win32API.CallNextHookEx(IntPtr.Zero, code, wParam, lParam); 105 | 106 | var args = (MouseArgs)lParam; 107 | var state = (RawMouseState)wParam; 108 | 109 | if (state == RawMouseState.LeftButtonDown) HandleKeyDown(RawKey.LeftButton); 110 | else if (state == RawMouseState.LeftButtonUp) HandleKeyUp(RawKey.LeftButton); 111 | else if (state == RawMouseState.RightButtonDown) HandleKeyDown(RawKey.RightButton); 112 | else if (state == RawMouseState.RightButtonUp) HandleKeyUp(RawKey.RightButton); 113 | else if (state == RawMouseState.MiddleButtonDown) HandleKeyDown(RawKey.MiddleButton); 114 | else if (state == RawMouseState.MiddleButtonUp) HandleKeyUp(RawKey.MiddleButton); 115 | else if (state == RawMouseState.ExtraButtonDown) HandleKeyDown(GetExtraButtonKey()); 116 | else if (state == RawMouseState.ExtraButtonUp) HandleKeyUp(GetExtraButtonKey()); 117 | else if (state == RawMouseState.MouseWheel) HandleKeyDownUp(GetWheelKey()); 118 | else if (state == RawMouseState.MouseWheelHorizontal) HandleKeyDownUp(GetWheelHorizontalKey()); 119 | 120 | return InterceptMessages ? 1 : Win32API.CallNextHookEx(IntPtr.Zero, 0, wParam, lParam); 121 | 122 | short GetWheelDelta () => (short)(args.MouseData >> 16 & 0xFFFF); 123 | RawKey GetWheelKey () => GetWheelDelta() < 0 ? RawKey.WheelDown : RawKey.WheelUp; 124 | RawKey GetWheelHorizontalKey () => GetWheelDelta() < 0 ? RawKey.WheelLeft : RawKey.WheelRight; 125 | RawKey GetExtraButtonKey () => (short)(args.MouseData >> 16 & 0xFFFF) == 1 ? RawKey.ExtraButton1 : RawKey.ExtraButton2; 126 | } 127 | 128 | private static void HandleKeyDown (RawKey key) 129 | { 130 | var added = pressedKeys.Add(key); 131 | if (added) OnKeyDown?.Invoke(key); 132 | } 133 | 134 | private static void HandleKeyUp (RawKey key) 135 | { 136 | pressedKeys.Remove(key); 137 | OnKeyUp?.Invoke(key); 138 | } 139 | 140 | private static void HandleKeyDownUp (RawKey key) 141 | { 142 | HandleKeyDown(key); 143 | HandleKeyUp(key); 144 | } 145 | 146 | private static bool CanHandleHook () 147 | { 148 | return WorkInBackground || Application.isFocused; 149 | } 150 | 151 | // https://github.com/Elringus/UnityRawInput/issues/19#issuecomment-1227462101 152 | private static void EnsureRunInBackgroundEnabled () 153 | { 154 | if (Application.runInBackground) return; 155 | Debug.LogWarning("Application isn't set to run in background! Not enabling this option will " + 156 | "cause severe mouse slowdown if the window isn't in focus. Enabling behavior for this play session, " + 157 | "but you should explicitly enable this in \"Build Settings→Player Settings→Player→Resolution and " + 158 | "Presentation→Run In Background\"."); 159 | Application.runInBackground = true; 160 | } 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /Assets/Editor/PackageExporter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using UnityEditor; 7 | using UnityEditor.SceneManagement; 8 | using UnityEngine; 9 | 10 | public class PackageExporter : EditorWindow 11 | { 12 | public interface IProcessor 13 | { 14 | Task OnPackagePreProcessAsync (); 15 | Task OnPackagePostProcessAsync (); 16 | } 17 | 18 | private static string PackageName { get => PlayerPrefs.GetString(prefsPrefix + "PackageName"); set => PlayerPrefs.SetString(prefsPrefix + "PackageName", value); } 19 | private static string Copyright { get => PlayerPrefs.GetString(prefsPrefix + "Copyright"); set => PlayerPrefs.SetString(prefsPrefix + "Copyright", value); } 20 | private static string LicenseFilePath { get => PlayerPrefs.GetString(prefsPrefix + "LicenseFilePath"); set => PlayerPrefs.SetString(prefsPrefix + "LicenseFilePath", value); } 21 | private static string LicenseAssetPath => AssetsPath + "/" + defaultLicenseFileName + ".md"; 22 | private static string AssetsPath => "Assets/" + PackageName; 23 | private static string OutputPath { get => PlayerPrefs.GetString(prefsPrefix + "OutputPath"); set => PlayerPrefs.SetString(prefsPrefix + "OutputPath", value); } 24 | private static string OutputFileName => PackageName; 25 | private static string IgnoredAssetGUIds { get => PlayerPrefs.GetString(prefsPrefix + "IgnoredAssetGUIds"); set => PlayerPrefs.SetString(prefsPrefix + "IgnoredAssetGUIds", value); } 26 | private static bool IsAnyPathsIgnored => !string.IsNullOrEmpty(IgnoredAssetGUIds); 27 | private static bool IsReadyToExport => !string.IsNullOrEmpty(OutputPath) && !string.IsNullOrEmpty(OutputFileName); 28 | private static bool ExportAsUnityPackage { get => PlayerPrefs.GetInt(prefsPrefix + "ExportAsUnityPackage", 1) == 1; set => PlayerPrefs.SetInt(prefsPrefix + "ExportAsUnityPackage", value ? 1 : 0); } 29 | private static bool PublishToGit { get => PlayerPrefs.GetInt(prefsPrefix + "PublishToGit", 0) == 1; set => PlayerPrefs.SetInt(prefsPrefix + "PublishToGit", value ? 1 : 0); } 30 | private static string GitShellPath { get => PlayerPrefs.GetString(prefsPrefix + "GitShellPath"); set => PlayerPrefs.SetString(prefsPrefix + "GitShellPath", value); } 31 | private static string GitScriptPath { get => PlayerPrefs.GetString(prefsPrefix + "GitScriptPath"); set => PlayerPrefs.SetString(prefsPrefix + "GitScriptPath", value); } 32 | private static bool ApplyModificationsToGit { get => PlayerPrefs.GetInt(prefsPrefix + "ApplyModificationsToGit", 0) == 1; set => PlayerPrefs.SetInt(prefsPrefix + "ApplyModificationsToGit", value ? 1 : 0); } 33 | private static string OverrideNamespace { get => PlayerPrefs.GetString(prefsPrefix + "OverrideNamespace"); set => PlayerPrefs.SetString(prefsPrefix + "OverrideNamespace", value); } 34 | 35 | private const string prefsPrefix = "PackageExporter."; 36 | private const string autoRefreshKey = "kAutoRefresh"; 37 | private const string defaultLicenseFileName = "LICENSE"; 38 | private const char newLine = '\n'; 39 | 40 | private static readonly Dictionary modifiedScripts = new Dictionary(); 41 | private static readonly List ignoredAssets = new List(); 42 | private static SceneSetup[] sceneSetup; 43 | 44 | public static void AddIgnoredAsset (string assetPath) 45 | { 46 | var guid = AssetDatabase.AssetPathToGUID(assetPath); 47 | if (!IgnoredAssetGUIds.Contains(guid)) IgnoredAssetGUIds += "," + guid; 48 | } 49 | 50 | public static void RemoveIgnoredAsset (string assetPath) 51 | { 52 | var guid = AssetDatabase.AssetPathToGUID(assetPath); 53 | if (!IgnoredAssetGUIds.Contains(guid)) IgnoredAssetGUIds = IgnoredAssetGUIds.Replace(guid, string.Empty); 54 | } 55 | 56 | private void OnEnable () 57 | { 58 | Initialize(); 59 | } 60 | 61 | private void OnGUI () 62 | { 63 | RenderGUI(); 64 | } 65 | 66 | [SettingsProvider] 67 | internal static SettingsProvider CreateProjectSettingsProvider () 68 | { 69 | var provider = new SettingsProvider("Project/Package Exporter", SettingsScope.Project); 70 | provider.activateHandler += (a, b) => Initialize(); 71 | provider.guiHandler += id => RenderGUI(); 72 | return provider; 73 | } 74 | 75 | private static void Initialize () 76 | { 77 | if (string.IsNullOrEmpty(PackageName)) 78 | PackageName = Application.productName; 79 | if (string.IsNullOrEmpty(LicenseFilePath)) 80 | LicenseFilePath = Application.dataPath.Replace("Assets", "") + defaultLicenseFileName; 81 | DeserializeIgnoredAssets(); 82 | } 83 | 84 | [MenuItem("Assets/+ Export Package", priority = 20)] 85 | private static void ExportPackage () 86 | { 87 | if (IsReadyToExport) 88 | ExportPackageImpl(); 89 | } 90 | 91 | private static void RenderGUI () 92 | { 93 | EditorGUILayout.LabelField("Package Exporter Settings", EditorStyles.boldLabel); 94 | EditorGUILayout.HelpBox("Settings are stored in editor's PlayerPrefs and won't be exposed in builds or project assets.", MessageType.Info); 95 | EditorGUILayout.Space(); 96 | PackageName = EditorGUILayout.TextField("Package Name", PackageName); 97 | Copyright = EditorGUILayout.TextField("Copyright Notice", Copyright); 98 | OverrideNamespace = EditorGUILayout.TextField("Override Namespace", OverrideNamespace); 99 | LicenseFilePath = EditorGUILayout.TextField("License File Path", LicenseFilePath); 100 | using (new EditorGUILayout.HorizontalScope()) 101 | { 102 | OutputPath = EditorGUILayout.TextField("Output Path", OutputPath); 103 | if (GUILayout.Button("Select", EditorStyles.miniButton, GUILayout.Width(65))) 104 | OutputPath = EditorUtility.OpenFolderPanel("Output Path", "", ""); 105 | } 106 | ExportAsUnityPackage = EditorGUILayout.Toggle("Export As Unity Package", ExportAsUnityPackage); 107 | PublishToGit = EditorGUILayout.Toggle("Publish To Git", PublishToGit); 108 | if (PublishToGit) 109 | { 110 | using (new EditorGUILayout.HorizontalScope()) 111 | { 112 | GitShellPath = EditorGUILayout.TextField("Git Shell Path", GitShellPath); 113 | if (GUILayout.Button("Select", EditorStyles.miniButton, GUILayout.Width(65))) 114 | GitShellPath = EditorUtility.OpenFilePanelWithFilters("Git Shell Path", "", new[] { "Executable", "exe" }); 115 | } 116 | using (new EditorGUILayout.HorizontalScope()) 117 | { 118 | GitScriptPath = EditorGUILayout.TextField("Git Script Path", GitScriptPath); 119 | if (GUILayout.Button("Select", EditorStyles.miniButton, GUILayout.Width(65))) 120 | GitScriptPath = EditorUtility.OpenFilePanelWithFilters("Git Script Path", "", new[] { "Shell", "sh" }); 121 | } 122 | ApplyModificationsToGit = EditorGUILayout.Toggle("Apply Modifications To Git", ApplyModificationsToGit); 123 | } 124 | EditorGUILayout.Space(); 125 | 126 | EditorGUI.BeginChangeCheck(); 127 | EditorGUILayout.LabelField("Ignored folders: "); 128 | for (int i = 0; i < ignoredAssets.Count; i++) 129 | ignoredAssets[i] = EditorGUILayout.ObjectField(ignoredAssets[i], typeof(UnityEngine.Object), false); 130 | if (GUILayout.Button("+")) ignoredAssets.Add(null); 131 | if (EditorGUI.EndChangeCheck()) SerializeIgnoredAssets(); 132 | } 133 | 134 | private static void SerializeIgnoredAssets () 135 | { 136 | var ignoredAssetsGUIDs = new List(); 137 | foreach (var asset in ignoredAssets) 138 | { 139 | if (!asset) continue; 140 | var assetPath = AssetDatabase.GetAssetPath(asset); 141 | var assetGUID = AssetDatabase.AssetPathToGUID(assetPath); 142 | ignoredAssetsGUIDs.Add(assetGUID); 143 | } 144 | IgnoredAssetGUIds = string.Join(",", ignoredAssetsGUIDs.ToArray()); 145 | } 146 | 147 | private static void DeserializeIgnoredAssets () 148 | { 149 | ignoredAssets.Clear(); 150 | var ignoredAssetsGUIDs = IgnoredAssetGUIds.Split(','); 151 | foreach (var guid in ignoredAssetsGUIDs) 152 | { 153 | if (string.IsNullOrEmpty(guid)) continue; 154 | var assetPath = AssetDatabase.GUIDToAssetPath(guid); 155 | var asset = AssetDatabase.LoadAssetAtPath(assetPath); 156 | if (asset) ignoredAssets.Add(asset); 157 | } 158 | } 159 | 160 | private static bool IsAssetIgnored (string assetPath) 161 | { 162 | var guid = AssetDatabase.AssetPathToGUID(assetPath); 163 | return IgnoredAssetGUIds.Contains(guid); 164 | } 165 | 166 | private static async void ExportPackageImpl () 167 | { 168 | DisplayProgressBar("Preparing for export...", 0f); 169 | 170 | // Disable auto recompile. 171 | var wasAutoRefreshEnabled = EditorPrefs.GetBool(autoRefreshKey); 172 | EditorPrefs.SetBool(autoRefreshKey, false); 173 | 174 | // Load a temp scene and unload assets to prevent reference errors. 175 | sceneSetup = EditorSceneManager.GetSceneManagerSetup(); 176 | EditorSceneManager.NewScene(NewSceneSetup.EmptyScene); 177 | EditorUtility.UnloadUnusedAssetsImmediate(true); 178 | 179 | DisplayProgressBar("Pre-processing assets...", 0f); 180 | var processors = GetProcessors(); 181 | foreach (var proc in processors) 182 | await proc.OnPackagePreProcessAsync(); 183 | 184 | var assetPaths = AssetDatabase.GetAllAssetPaths().Where(p => p.StartsWith(AssetsPath)).ToArray(); 185 | var ignoredPaths = assetPaths.Where(IsAssetIgnored).ToArray(); 186 | var unignoredPaths = assetPaths.Where(p => !IsAssetIgnored(p)).ToArray(); 187 | 188 | // Temporary hide ignored assets. 189 | DisplayProgressBar("Hiding ignored assets...", .1f); 190 | if (IsAnyPathsIgnored) 191 | { 192 | foreach (var path in ignoredPaths) 193 | File.SetAttributes(path, File.GetAttributes(path) | FileAttributes.Hidden); 194 | AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport); 195 | } 196 | 197 | // Add license file. 198 | var needToAddLicense = File.Exists(LicenseFilePath); 199 | if (needToAddLicense) 200 | { 201 | File.Copy(LicenseFilePath, LicenseAssetPath, true); 202 | AssetDatabase.ImportAsset(LicenseAssetPath, ImportAssetOptions.ForceSynchronousImport); 203 | } 204 | 205 | // Publish GitHub branch before modifications. 206 | if (!ApplyModificationsToGit && PublishToGit) 207 | { 208 | using (var process = System.Diagnostics.Process.Start(GitShellPath, $"\"{GitScriptPath}\"")) 209 | { 210 | process?.WaitForExit(); 211 | } 212 | } 213 | 214 | // Modify scripts (namespace and copyright). 215 | DisplayProgressBar("Modifying scripts...", .25f); 216 | modifiedScripts.Clear(); 217 | var needToModify = !string.IsNullOrEmpty(Copyright) || !string.IsNullOrEmpty(OverrideNamespace); 218 | if (needToModify) 219 | { 220 | foreach (var path in unignoredPaths) 221 | { 222 | if (!path.EndsWith(".cs") && !path.EndsWith(".shader") && !path.EndsWith(".cginc")) continue; 223 | if (path.Contains("ThirdParty")) continue; 224 | 225 | var fullPath = Application.dataPath.Replace("Assets", string.Empty) + path; 226 | var originalScriptText = File.ReadAllText(fullPath); 227 | 228 | string scriptText = string.Empty; 229 | 230 | var copyright = string.IsNullOrEmpty(Copyright) ? string.Empty : "// " + Copyright; 231 | if (!string.IsNullOrEmpty(copyright)) 232 | scriptText += copyright + newLine + newLine; 233 | 234 | scriptText += originalScriptText; 235 | 236 | if (!string.IsNullOrEmpty(OverrideNamespace)) 237 | scriptText = scriptText 238 | .Replace($"namespace {PackageName}", $"namespace {OverrideNamespace}") 239 | .Replace($"using {PackageName}", $"using {OverrideNamespace}"); 240 | 241 | File.WriteAllText(fullPath, scriptText); 242 | 243 | modifiedScripts.Add(fullPath, originalScriptText); 244 | } 245 | } 246 | 247 | // Export the package. 248 | DisplayProgressBar("Writing package file...", .5f); 249 | if (ExportAsUnityPackage) 250 | AssetDatabase.ExportPackage(AssetsPath, OutputPath + "/" + OutputFileName + ".unitypackage", ExportPackageOptions.Recurse); 251 | else 252 | { 253 | try 254 | { 255 | var sourcePath = Path.Combine(Application.dataPath, PackageName).Replace("\\", "/"); 256 | var destPath = Path.Combine(OutputPath, OutputFileName).Replace("\\", "/"); 257 | var sourceDir = new DirectoryInfo(sourcePath); 258 | 259 | var hiddenFolders = sourceDir.GetDirectories("*", SearchOption.AllDirectories) 260 | .Where(d => (d.Attributes & FileAttributes.Hidden) != 0) 261 | .Select(d => d.FullName).ToList(); 262 | var packageFiles = sourceDir.GetFiles("*.*", SearchOption.AllDirectories) 263 | .Where(f => (f.Attributes & FileAttributes.Hidden) == 0 && 264 | !hiddenFolders.Any(d => f.FullName.StartsWith(d))).ToList(); 265 | 266 | foreach (var packageFile in packageFiles) 267 | { 268 | var sourceFilePath = packageFile.FullName.Replace("\\", "/"); 269 | var destFilePath = sourceFilePath.Replace(sourcePath, destPath); 270 | Directory.CreateDirectory(Path.GetDirectoryName(destFilePath)); 271 | File.Copy(sourceFilePath, destFilePath, true); 272 | } 273 | } 274 | catch (Exception e) { Debug.LogError(e.Message); } 275 | } 276 | 277 | // Publish GitHub branch after modifications. 278 | if (ApplyModificationsToGit && PublishToGit) 279 | { 280 | using (var process = System.Diagnostics.Process.Start(GitShellPath, $"\"{GitScriptPath}\"")) 281 | { 282 | process.WaitForExit(); 283 | } 284 | } 285 | 286 | // Restore modified scripts. 287 | DisplayProgressBar("Restoring modified scripts...", .75f); 288 | if (needToModify) 289 | { 290 | foreach (var modifiedScript in modifiedScripts) 291 | File.WriteAllText(modifiedScript.Key, modifiedScript.Value); 292 | } 293 | 294 | // Remove previously added license asset. 295 | if (needToAddLicense) AssetDatabase.DeleteAsset(LicenseAssetPath); 296 | 297 | // Un-hide ignored assets. 298 | DisplayProgressBar("Un-hiding ignored assets...", .95f); 299 | if (IsAnyPathsIgnored) 300 | { 301 | foreach (var path in ignoredPaths) 302 | File.SetAttributes(path, File.GetAttributes(path) & ~FileAttributes.Hidden); 303 | AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport); 304 | } 305 | 306 | DisplayProgressBar("Post-processing assets...", 1f); 307 | foreach (var proc in processors) 308 | await proc.OnPackagePostProcessAsync(); 309 | 310 | EditorPrefs.SetBool(autoRefreshKey, wasAutoRefreshEnabled); 311 | EditorSceneManager.RestoreSceneManagerSetup(sceneSetup); 312 | 313 | EditorUtility.ClearProgressBar(); 314 | } 315 | 316 | private static void DisplayProgressBar (string activity, float progress) 317 | { 318 | EditorUtility.DisplayProgressBar($"Exporting {PackageName}", activity, progress); 319 | } 320 | 321 | private static IReadOnlyCollection GetProcessors () 322 | { 323 | return AppDomain.CurrentDomain.GetAssemblies() 324 | .SelectMany(a => a.GetTypes()) 325 | .Where(t => typeof(IProcessor).IsAssignableFrom(t) && t.IsClass) 326 | .Select(t => (IProcessor)Activator.CreateInstance(t)).ToArray(); 327 | } 328 | } 329 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 20 7 | productGUID: ee7f26f10f2429140b4767e5a9947c20 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: Elringus 16 | productName: UnityRawInput 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosUseCustomAppBackgroundBehavior: 0 56 | iosAllowHTTPDownload: 1 57 | allowedAutorotateToPortrait: 1 58 | allowedAutorotateToPortraitUpsideDown: 1 59 | allowedAutorotateToLandscapeRight: 1 60 | allowedAutorotateToLandscapeLeft: 1 61 | useOSAutorotation: 1 62 | use32BitDisplayBuffer: 1 63 | preserveFramebufferAlpha: 0 64 | disableDepthAndStencilBuffers: 0 65 | androidStartInFullscreen: 1 66 | androidRenderOutsideSafeArea: 0 67 | androidUseSwappy: 0 68 | androidBlitType: 0 69 | androidResizableWindow: 0 70 | androidDefaultWindowWidth: 1920 71 | androidDefaultWindowHeight: 1080 72 | androidMinimumWindowWidth: 400 73 | androidMinimumWindowHeight: 300 74 | androidFullscreenMode: 1 75 | defaultIsNativeResolution: 1 76 | macRetinaSupport: 1 77 | runInBackground: 1 78 | captureSingleScreen: 0 79 | muteOtherAudioSources: 0 80 | Prepare IOS For Recording: 0 81 | Force IOS Speakers When Recording: 0 82 | deferSystemGesturesMode: 0 83 | hideHomeButton: 0 84 | submitAnalytics: 1 85 | usePlayerLog: 1 86 | bakeCollisionMeshes: 0 87 | forceSingleInstance: 0 88 | useFlipModelSwapchain: 1 89 | resizableWindow: 0 90 | useMacAppStoreValidation: 0 91 | macAppStoreCategory: public.app-category.games 92 | gpuSkinning: 0 93 | xboxPIXTextureCapture: 0 94 | xboxEnableAvatar: 0 95 | xboxEnableKinect: 0 96 | xboxEnableKinectAutoTracking: 0 97 | xboxEnableFitness: 0 98 | visibleInBackground: 1 99 | allowFullscreenSwitch: 1 100 | fullscreenMode: 1 101 | xboxSpeechDB: 0 102 | xboxEnableHeadOrientation: 0 103 | xboxEnableGuest: 0 104 | xboxEnablePIXSampling: 0 105 | metalFramebufferOnly: 0 106 | xboxOneResolution: 0 107 | xboxOneSResolution: 0 108 | xboxOneXResolution: 3 109 | xboxOneMonoLoggingLevel: 0 110 | xboxOneLoggingLevel: 1 111 | xboxOneDisableEsram: 0 112 | xboxOneEnableTypeOptimization: 0 113 | xboxOnePresentImmediateThreshold: 0 114 | switchQueueCommandMemory: 1048576 115 | switchQueueControlMemory: 16384 116 | switchQueueComputeMemory: 262144 117 | switchNVNShaderPoolsGranularity: 33554432 118 | switchNVNDefaultPoolsGranularity: 16777216 119 | switchNVNOtherPoolsGranularity: 16777216 120 | switchNVNMaxPublicTextureIDCount: 0 121 | switchNVNMaxPublicSamplerIDCount: 0 122 | stadiaPresentMode: 0 123 | stadiaTargetFramerate: 0 124 | vulkanNumSwapchainBuffers: 3 125 | vulkanEnableSetSRGBWrite: 0 126 | vulkanEnableLateAcquireNextImage: 0 127 | m_SupportedAspectRatios: 128 | 4:3: 1 129 | 5:4: 1 130 | 16:10: 1 131 | 16:9: 1 132 | Others: 1 133 | bundleVersion: 1.0 134 | preloadedAssets: [] 135 | metroInputSource: 0 136 | wsaTransparentSwapchain: 0 137 | m_HolographicPauseOnTrackingLoss: 1 138 | xboxOneDisableKinectGpuReservation: 0 139 | xboxOneEnable7thCore: 0 140 | vrSettings: 141 | cardboard: 142 | depthFormat: 0 143 | enableTransitionView: 0 144 | daydream: 145 | depthFormat: 0 146 | useSustainedPerformanceMode: 0 147 | enableVideoLayer: 0 148 | useProtectedVideoMemory: 0 149 | minimumSupportedHeadTracking: 0 150 | maximumSupportedHeadTracking: 1 151 | hololens: 152 | depthFormat: 1 153 | depthBufferSharingEnabled: 0 154 | lumin: 155 | depthFormat: 0 156 | frameTiming: 2 157 | enableGLCache: 0 158 | glCacheMaxBlobSize: 524288 159 | glCacheMaxFileSize: 8388608 160 | oculus: 161 | sharedDepthBuffer: 0 162 | dashSupport: 0 163 | lowOverheadMode: 0 164 | protectedContext: 0 165 | v2Signing: 1 166 | enable360StereoCapture: 0 167 | isWsaHolographicRemotingEnabled: 0 168 | enableFrameTimingStats: 0 169 | useHDRDisplay: 0 170 | D3DHDRBitDepth: 0 171 | m_ColorGamuts: 00000000 172 | targetPixelDensity: 30 173 | resolutionScalingMode: 0 174 | androidSupportedAspectRatio: 1 175 | androidMaxAspectRatio: 2.1 176 | applicationIdentifier: {} 177 | buildNumber: {} 178 | AndroidBundleVersionCode: 1 179 | AndroidMinSdkVersion: 19 180 | AndroidTargetSdkVersion: 0 181 | AndroidPreferredInstallLocation: 1 182 | aotOptions: 183 | stripEngineCode: 1 184 | iPhoneStrippingLevel: 0 185 | iPhoneScriptCallOptimization: 0 186 | ForceInternetPermission: 0 187 | ForceSDCardPermission: 0 188 | CreateWallpaper: 0 189 | APKExpansionFiles: 0 190 | keepLoadedShadersAlive: 0 191 | StripUnusedMeshComponents: 0 192 | VertexChannelCompressionMask: 214 193 | iPhoneSdkVersion: 988 194 | iOSTargetOSVersionString: 10.0 195 | tvOSSdkVersion: 0 196 | tvOSRequireExtendedGameController: 0 197 | tvOSTargetOSVersionString: 10.0 198 | uIPrerenderedIcon: 0 199 | uIRequiresPersistentWiFi: 0 200 | uIRequiresFullScreen: 1 201 | uIStatusBarHidden: 1 202 | uIExitOnSuspend: 0 203 | uIStatusBarStyle: 0 204 | appleTVSplashScreen: {fileID: 0} 205 | appleTVSplashScreen2x: {fileID: 0} 206 | tvOSSmallIconLayers: [] 207 | tvOSSmallIconLayers2x: [] 208 | tvOSLargeIconLayers: [] 209 | tvOSLargeIconLayers2x: [] 210 | tvOSTopShelfImageLayers: [] 211 | tvOSTopShelfImageLayers2x: [] 212 | tvOSTopShelfImageWideLayers: [] 213 | tvOSTopShelfImageWideLayers2x: [] 214 | iOSLaunchScreenType: 0 215 | iOSLaunchScreenPortrait: {fileID: 0} 216 | iOSLaunchScreenLandscape: {fileID: 0} 217 | iOSLaunchScreenBackgroundColor: 218 | serializedVersion: 2 219 | rgba: 0 220 | iOSLaunchScreenFillPct: 100 221 | iOSLaunchScreenSize: 100 222 | iOSLaunchScreenCustomXibPath: 223 | iOSLaunchScreeniPadType: 0 224 | iOSLaunchScreeniPadImage: {fileID: 0} 225 | iOSLaunchScreeniPadBackgroundColor: 226 | serializedVersion: 2 227 | rgba: 0 228 | iOSLaunchScreeniPadFillPct: 100 229 | iOSLaunchScreeniPadSize: 100 230 | iOSLaunchScreeniPadCustomXibPath: 231 | iOSUseLaunchScreenStoryboard: 0 232 | iOSLaunchScreenCustomStoryboardPath: 233 | iOSDeviceRequirements: [] 234 | iOSURLSchemes: [] 235 | iOSBackgroundModes: 0 236 | iOSMetalForceHardShadows: 0 237 | metalEditorSupport: 1 238 | metalAPIValidation: 1 239 | iOSRenderExtraFrameOnPause: 0 240 | iosCopyPluginsCodeInsteadOfSymlink: 0 241 | appleDeveloperTeamID: 242 | iOSManualSigningProvisioningProfileID: 243 | tvOSManualSigningProvisioningProfileID: 244 | iOSManualSigningProvisioningProfileType: 0 245 | tvOSManualSigningProvisioningProfileType: 0 246 | appleEnableAutomaticSigning: 0 247 | iOSRequireARKit: 0 248 | iOSAutomaticallyDetectAndAddCapabilities: 1 249 | appleEnableProMotion: 0 250 | clonedFromGUID: 00000000000000000000000000000000 251 | templatePackageId: 252 | templateDefaultScene: 253 | AndroidTargetArchitectures: 5 254 | AndroidTargetDevices: 0 255 | AndroidSplashScreenScale: 0 256 | androidSplashScreen: {fileID: 0} 257 | AndroidKeystoreName: '{inproject}: ' 258 | AndroidKeyaliasName: 259 | AndroidBuildApkPerCpuArchitecture: 0 260 | AndroidTVCompatibility: 1 261 | AndroidIsGame: 1 262 | AndroidEnableTango: 0 263 | androidEnableBanner: 1 264 | androidUseLowAccuracyLocation: 0 265 | androidUseCustomKeystore: 0 266 | m_AndroidBanners: 267 | - width: 320 268 | height: 180 269 | banner: {fileID: 0} 270 | androidGamepadSupportLevel: 0 271 | chromeosInputEmulation: 1 272 | AndroidValidateAppBundleSize: 1 273 | AndroidAppBundleSizeToValidate: 150 274 | m_BuildTargetIcons: [] 275 | m_BuildTargetPlatformIcons: [] 276 | m_BuildTargetBatching: [] 277 | m_BuildTargetGraphicsJobs: 278 | - m_BuildTarget: MacStandaloneSupport 279 | m_GraphicsJobs: 0 280 | - m_BuildTarget: Switch 281 | m_GraphicsJobs: 0 282 | - m_BuildTarget: MetroSupport 283 | m_GraphicsJobs: 0 284 | - m_BuildTarget: GameCoreScarlettSupport 285 | m_GraphicsJobs: 0 286 | - m_BuildTarget: AppleTVSupport 287 | m_GraphicsJobs: 0 288 | - m_BuildTarget: BJMSupport 289 | m_GraphicsJobs: 0 290 | - m_BuildTarget: LinuxStandaloneSupport 291 | m_GraphicsJobs: 0 292 | - m_BuildTarget: GameCoreXboxOneSupport 293 | m_GraphicsJobs: 0 294 | - m_BuildTarget: PS4Player 295 | m_GraphicsJobs: 0 296 | - m_BuildTarget: iOSSupport 297 | m_GraphicsJobs: 0 298 | - m_BuildTarget: PS5Player 299 | m_GraphicsJobs: 0 300 | - m_BuildTarget: WindowsStandaloneSupport 301 | m_GraphicsJobs: 0 302 | - m_BuildTarget: XboxOnePlayer 303 | m_GraphicsJobs: 0 304 | - m_BuildTarget: LuminSupport 305 | m_GraphicsJobs: 0 306 | - m_BuildTarget: CloudRendering 307 | m_GraphicsJobs: 0 308 | - m_BuildTarget: AndroidPlayer 309 | m_GraphicsJobs: 0 310 | - m_BuildTarget: WebGLSupport 311 | m_GraphicsJobs: 0 312 | m_BuildTargetGraphicsJobMode: 313 | - m_BuildTarget: PS4Player 314 | m_GraphicsJobMode: 0 315 | - m_BuildTarget: XboxOnePlayer 316 | m_GraphicsJobMode: 0 317 | m_BuildTargetGraphicsAPIs: [] 318 | m_BuildTargetVRSettings: [] 319 | openGLRequireES31: 0 320 | openGLRequireES31AEP: 0 321 | openGLRequireES32: 0 322 | m_TemplateCustomTags: {} 323 | mobileMTRendering: 324 | Android: 1 325 | iPhone: 1 326 | tvOS: 1 327 | m_BuildTargetGroupLightmapEncodingQuality: [] 328 | m_BuildTargetGroupLightmapSettings: [] 329 | playModeTestRunnerEnabled: 0 330 | runPlayModeTestAsEditModeTest: 0 331 | actionOnDotNetUnhandledException: 1 332 | enableInternalProfiler: 0 333 | logObjCUncaughtExceptions: 1 334 | enableCrashReportAPI: 0 335 | cameraUsageDescription: 336 | locationUsageDescription: 337 | microphoneUsageDescription: 338 | switchNetLibKey: 339 | switchSocketMemoryPoolSize: 6144 340 | switchSocketAllocatorPoolSize: 128 341 | switchSocketConcurrencyLimit: 14 342 | switchScreenResolutionBehavior: 2 343 | switchUseCPUProfiler: 0 344 | switchApplicationID: 0x01004b9000490000 345 | switchNSODependencies: 346 | switchTitleNames_0: 347 | switchTitleNames_1: 348 | switchTitleNames_2: 349 | switchTitleNames_3: 350 | switchTitleNames_4: 351 | switchTitleNames_5: 352 | switchTitleNames_6: 353 | switchTitleNames_7: 354 | switchTitleNames_8: 355 | switchTitleNames_9: 356 | switchTitleNames_10: 357 | switchTitleNames_11: 358 | switchTitleNames_12: 359 | switchTitleNames_13: 360 | switchTitleNames_14: 361 | switchTitleNames_15: 362 | switchPublisherNames_0: 363 | switchPublisherNames_1: 364 | switchPublisherNames_2: 365 | switchPublisherNames_3: 366 | switchPublisherNames_4: 367 | switchPublisherNames_5: 368 | switchPublisherNames_6: 369 | switchPublisherNames_7: 370 | switchPublisherNames_8: 371 | switchPublisherNames_9: 372 | switchPublisherNames_10: 373 | switchPublisherNames_11: 374 | switchPublisherNames_12: 375 | switchPublisherNames_13: 376 | switchPublisherNames_14: 377 | switchPublisherNames_15: 378 | switchIcons_0: {fileID: 0} 379 | switchIcons_1: {fileID: 0} 380 | switchIcons_2: {fileID: 0} 381 | switchIcons_3: {fileID: 0} 382 | switchIcons_4: {fileID: 0} 383 | switchIcons_5: {fileID: 0} 384 | switchIcons_6: {fileID: 0} 385 | switchIcons_7: {fileID: 0} 386 | switchIcons_8: {fileID: 0} 387 | switchIcons_9: {fileID: 0} 388 | switchIcons_10: {fileID: 0} 389 | switchIcons_11: {fileID: 0} 390 | switchIcons_12: {fileID: 0} 391 | switchIcons_13: {fileID: 0} 392 | switchIcons_14: {fileID: 0} 393 | switchIcons_15: {fileID: 0} 394 | switchSmallIcons_0: {fileID: 0} 395 | switchSmallIcons_1: {fileID: 0} 396 | switchSmallIcons_2: {fileID: 0} 397 | switchSmallIcons_3: {fileID: 0} 398 | switchSmallIcons_4: {fileID: 0} 399 | switchSmallIcons_5: {fileID: 0} 400 | switchSmallIcons_6: {fileID: 0} 401 | switchSmallIcons_7: {fileID: 0} 402 | switchSmallIcons_8: {fileID: 0} 403 | switchSmallIcons_9: {fileID: 0} 404 | switchSmallIcons_10: {fileID: 0} 405 | switchSmallIcons_11: {fileID: 0} 406 | switchSmallIcons_12: {fileID: 0} 407 | switchSmallIcons_13: {fileID: 0} 408 | switchSmallIcons_14: {fileID: 0} 409 | switchSmallIcons_15: {fileID: 0} 410 | switchManualHTML: 411 | switchAccessibleURLs: 412 | switchLegalInformation: 413 | switchMainThreadStackSize: 1048576 414 | switchPresenceGroupId: 415 | switchLogoHandling: 0 416 | switchReleaseVersion: 0 417 | switchDisplayVersion: 1.0.0 418 | switchStartupUserAccount: 0 419 | switchTouchScreenUsage: 0 420 | switchSupportedLanguagesMask: 0 421 | switchLogoType: 0 422 | switchApplicationErrorCodeCategory: 423 | switchUserAccountSaveDataSize: 0 424 | switchUserAccountSaveDataJournalSize: 0 425 | switchApplicationAttribute: 0 426 | switchCardSpecSize: -1 427 | switchCardSpecClock: -1 428 | switchRatingsMask: 0 429 | switchRatingsInt_0: 0 430 | switchRatingsInt_1: 0 431 | switchRatingsInt_2: 0 432 | switchRatingsInt_3: 0 433 | switchRatingsInt_4: 0 434 | switchRatingsInt_5: 0 435 | switchRatingsInt_6: 0 436 | switchRatingsInt_7: 0 437 | switchRatingsInt_8: 0 438 | switchRatingsInt_9: 0 439 | switchRatingsInt_10: 0 440 | switchRatingsInt_11: 0 441 | switchRatingsInt_12: 0 442 | switchLocalCommunicationIds_0: 443 | switchLocalCommunicationIds_1: 444 | switchLocalCommunicationIds_2: 445 | switchLocalCommunicationIds_3: 446 | switchLocalCommunicationIds_4: 447 | switchLocalCommunicationIds_5: 448 | switchLocalCommunicationIds_6: 449 | switchLocalCommunicationIds_7: 450 | switchParentalControl: 0 451 | switchAllowsScreenshot: 1 452 | switchAllowsVideoCapturing: 1 453 | switchAllowsRuntimeAddOnContentInstall: 0 454 | switchDataLossConfirmation: 0 455 | switchUserAccountLockEnabled: 0 456 | switchSystemResourceMemory: 16777216 457 | switchSupportedNpadStyles: 3 458 | switchNativeFsCacheSize: 32 459 | switchIsHoldTypeHorizontal: 0 460 | switchSupportedNpadCount: 8 461 | switchSocketConfigEnabled: 0 462 | switchTcpInitialSendBufferSize: 32 463 | switchTcpInitialReceiveBufferSize: 64 464 | switchTcpAutoSendBufferSizeMax: 256 465 | switchTcpAutoReceiveBufferSizeMax: 256 466 | switchUdpSendBufferSize: 9 467 | switchUdpReceiveBufferSize: 42 468 | switchSocketBufferEfficiency: 4 469 | switchSocketInitializeEnabled: 1 470 | switchNetworkInterfaceManagerInitializeEnabled: 1 471 | switchPlayerConnectionEnabled: 1 472 | switchUseMicroSleepForYield: 1 473 | switchMicroSleepForYieldTime: 25 474 | ps4NPAgeRating: 12 475 | ps4NPTitleSecret: 476 | ps4NPTrophyPackPath: 477 | ps4ParentalLevel: 11 478 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 479 | ps4Category: 0 480 | ps4MasterVersion: 01.00 481 | ps4AppVersion: 01.00 482 | ps4AppType: 0 483 | ps4ParamSfxPath: 484 | ps4VideoOutPixelFormat: 0 485 | ps4VideoOutInitialWidth: 1920 486 | ps4VideoOutBaseModeInitialWidth: 1920 487 | ps4VideoOutReprojectionRate: 60 488 | ps4PronunciationXMLPath: 489 | ps4PronunciationSIGPath: 490 | ps4BackgroundImagePath: 491 | ps4StartupImagePath: 492 | ps4StartupImagesFolder: 493 | ps4IconImagesFolder: 494 | ps4SaveDataImagePath: 495 | ps4SdkOverride: 496 | ps4BGMPath: 497 | ps4ShareFilePath: 498 | ps4ShareOverlayImagePath: 499 | ps4PrivacyGuardImagePath: 500 | ps4ExtraSceSysFile: 501 | ps4NPtitleDatPath: 502 | ps4RemotePlayKeyAssignment: -1 503 | ps4RemotePlayKeyMappingDir: 504 | ps4PlayTogetherPlayerCount: 0 505 | ps4EnterButtonAssignment: 1 506 | ps4ApplicationParam1: 0 507 | ps4ApplicationParam2: 0 508 | ps4ApplicationParam3: 0 509 | ps4ApplicationParam4: 0 510 | ps4DownloadDataSize: 0 511 | ps4GarlicHeapSize: 2048 512 | ps4ProGarlicHeapSize: 2560 513 | playerPrefsMaxSize: 32768 514 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 515 | ps4pnSessions: 1 516 | ps4pnPresence: 1 517 | ps4pnFriends: 1 518 | ps4pnGameCustomData: 1 519 | playerPrefsSupport: 0 520 | enableApplicationExit: 0 521 | resetTempFolder: 1 522 | restrictedAudioUsageRights: 0 523 | ps4UseResolutionFallback: 0 524 | ps4ReprojectionSupport: 0 525 | ps4UseAudio3dBackend: 0 526 | ps4UseLowGarlicFragmentationMode: 1 527 | ps4SocialScreenEnabled: 0 528 | ps4ScriptOptimizationLevel: 0 529 | ps4Audio3dVirtualSpeakerCount: 14 530 | ps4attribCpuUsage: 0 531 | ps4PatchPkgPath: 532 | ps4PatchLatestPkgPath: 533 | ps4PatchChangeinfoPath: 534 | ps4PatchDayOne: 0 535 | ps4attribUserManagement: 0 536 | ps4attribMoveSupport: 0 537 | ps4attrib3DSupport: 0 538 | ps4attribShareSupport: 0 539 | ps4attribExclusiveVR: 0 540 | ps4disableAutoHideSplash: 0 541 | ps4videoRecordingFeaturesUsed: 0 542 | ps4contentSearchFeaturesUsed: 0 543 | ps4CompatibilityPS5: 0 544 | ps4AllowPS5Detection: 0 545 | ps4GPU800MHz: 1 546 | ps4attribEyeToEyeDistanceSettingVR: 0 547 | ps4IncludedModules: [] 548 | ps4attribVROutputEnabled: 0 549 | ps5ParamFilePath: 550 | ps5VideoOutPixelFormat: 0 551 | ps5VideoOutInitialWidth: 1920 552 | ps5VideoOutOutputMode: 1 553 | ps5BackgroundImagePath: 554 | ps5StartupImagePath: 555 | ps5Pic2Path: 556 | ps5StartupImagesFolder: 557 | ps5IconImagesFolder: 558 | ps5SaveDataImagePath: 559 | ps5SdkOverride: 560 | ps5BGMPath: 561 | ps5ShareOverlayImagePath: 562 | ps5NPConfigZipPath: 563 | ps5Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 564 | ps5UseResolutionFallback: 0 565 | ps5UseAudio3dBackend: 0 566 | ps5ScriptOptimizationLevel: 2 567 | ps5Audio3dVirtualSpeakerCount: 14 568 | ps5UpdateReferencePackage: 569 | ps5disableAutoHideSplash: 0 570 | ps5OperatingSystemCanDisableSplashScreen: 0 571 | ps5IncludedModules: [] 572 | ps5SharedBinaryContentLabels: [] 573 | ps5SharedBinarySystemFolders: [] 574 | monoEnv: 575 | splashScreenBackgroundSourceLandscape: {fileID: 0} 576 | splashScreenBackgroundSourcePortrait: {fileID: 0} 577 | blurSplashScreenBackground: 1 578 | spritePackerPolicy: 579 | webGLMemorySize: 256 580 | webGLExceptionSupport: 1 581 | webGLNameFilesAsHashes: 0 582 | webGLDataCaching: 0 583 | webGLDebugSymbols: 0 584 | webGLEmscriptenArgs: 585 | webGLModulesDirectory: 586 | webGLTemplate: APPLICATION:Default 587 | webGLAnalyzeBuildSize: 0 588 | webGLUseEmbeddedResources: 0 589 | webGLCompressionFormat: 1 590 | webGLLinkerTarget: 1 591 | webGLThreadsSupport: 0 592 | webGLWasmStreaming: 0 593 | scriptingDefineSymbols: {} 594 | platformArchitecture: {} 595 | scriptingBackend: {} 596 | il2cppCompilerConfiguration: {} 597 | managedStrippingLevel: {} 598 | incrementalIl2cppBuild: {} 599 | suppressCommonWarnings: 1 600 | allowUnsafeCode: 0 601 | additionalIl2CppArgs: 602 | scriptingRuntimeVersion: 1 603 | gcIncremental: 0 604 | assemblyVersionValidation: 1 605 | gcWBarrierValidation: 0 606 | apiCompatibilityLevelPerPlatform: {} 607 | m_RenderingPath: 1 608 | m_MobileRenderingPath: 1 609 | metroPackageName: UnityRawInput 610 | metroPackageVersion: 611 | metroCertificatePath: 612 | metroCertificatePassword: 613 | metroCertificateSubject: 614 | metroCertificateIssuer: 615 | metroCertificateNotAfter: 0000000000000000 616 | metroApplicationDescription: UnityRawInput 617 | wsaImages: {} 618 | metroTileShortName: 619 | metroTileShowName: 0 620 | metroMediumTileShowName: 0 621 | metroLargeTileShowName: 0 622 | metroWideTileShowName: 0 623 | metroSupportStreamingInstall: 0 624 | metroLastRequiredScene: 0 625 | metroDefaultTileSize: 1 626 | metroTileForegroundText: 2 627 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 628 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 629 | a: 1} 630 | metroSplashScreenUseBackgroundColor: 0 631 | platformCapabilities: {} 632 | metroTargetDeviceFamilies: {} 633 | metroFTAName: 634 | metroFTAFileTypes: [] 635 | metroProtocolName: 636 | XboxOneProductId: 637 | XboxOneUpdateKey: 638 | XboxOneSandboxId: 639 | XboxOneContentId: 640 | XboxOneTitleId: 641 | XboxOneSCId: 642 | XboxOneGameOsOverridePath: 643 | XboxOnePackagingOverridePath: 644 | XboxOneAppManifestOverridePath: 645 | XboxOneVersion: 1.0.0.0 646 | XboxOnePackageEncryption: 0 647 | XboxOnePackageUpdateGranularity: 2 648 | XboxOneDescription: 649 | XboxOneLanguage: 650 | - enus 651 | XboxOneCapability: [] 652 | XboxOneGameRating: {} 653 | XboxOneIsContentPackage: 0 654 | XboxOneEnhancedXboxCompatibilityMode: 0 655 | XboxOneEnableGPUVariability: 0 656 | XboxOneSockets: {} 657 | XboxOneSplashScreen: {fileID: 0} 658 | XboxOneAllowedProductIds: [] 659 | XboxOnePersistentLocalStorageSize: 0 660 | XboxOneXTitleMemory: 8 661 | XboxOneOverrideIdentityName: 662 | XboxOneOverrideIdentityPublisher: 663 | vrEditorSettings: 664 | daydream: 665 | daydreamIconForeground: {fileID: 0} 666 | daydreamIconBackground: {fileID: 0} 667 | cloudServicesEnabled: {} 668 | luminIcon: 669 | m_Name: 670 | m_ModelFolderPath: 671 | m_PortalFolderPath: 672 | luminCert: 673 | m_CertPath: 674 | m_SignPackage: 1 675 | luminIsChannelApp: 0 676 | luminVersion: 677 | m_VersionCode: 1 678 | m_VersionName: 679 | apiCompatibilityLevel: 6 680 | cloudProjectId: 681 | framebufferDepthMemorylessMode: 0 682 | projectName: 683 | organizationId: 684 | cloudEnabled: 0 685 | enableNativePlatformBackendsForNewInputSystem: 0 686 | disableOldInputManagerSupport: 0 687 | legacyClampBlendShapeWeights: 1 688 | --------------------------------------------------------------------------------