├── .DS_Store ├── .gitignore ├── .gradle ├── 4.6 │ ├── fileChanges │ │ └── last-build.bin │ ├── fileHashes │ │ └── fileHashes.lock │ └── taskHistory │ │ └── taskHistory.lock └── buildOutputCleanup │ ├── buildOutputCleanup.lock │ └── cache.properties ├── .vscode └── settings.json ├── .vsconfig ├── Assets ├── .DS_Store ├── Editor.meta ├── Editor │ ├── TAP.meta │ └── TAP │ │ ├── TAPPostProcess.cs │ │ └── TAPPostProcess.cs.meta ├── Resources.meta ├── Resources │ ├── BillingMode.json │ └── BillingMode.json.meta ├── Scenes.meta ├── Scenes │ ├── TAPTestScene.unity │ ├── TAPTestScene.unity.meta │ ├── TAPTestSceneSettings.lighting │ └── TAPTestSceneSettings.lighting.meta ├── Scripts.meta ├── Scripts │ ├── AndroidPermissions.cs │ └── AndroidPermissions.cs.meta ├── TAP.meta └── TAP │ ├── .DS_Store │ ├── Android.meta │ ├── Android │ ├── TapInputAndroid.cs │ ├── TapInputAndroid.cs.meta │ ├── tap-android-sdk-release.aar │ ├── tap-android-sdk-release.aar.meta │ ├── tap-unity-release.aar │ └── tap-unity-release.aar.meta │ ├── Main.meta │ ├── Main │ ├── ITapInput.cs │ ├── ITapInput.cs.meta │ ├── RawSensorData.cs │ ├── RawSensorData.cs.meta │ ├── Singleton.cs │ ├── Singleton.cs.meta │ ├── TapAirGesture.cs │ ├── TapAirGesture.cs.meta │ ├── TapCombination.cs │ ├── TapCombination.cs.meta │ ├── TapInputEditor.cs │ ├── TapInputEditor.cs.meta │ ├── TapInputManager.cs │ └── TapInputManager.cs.meta │ ├── Test.meta │ ├── Test │ ├── DragThisToYourSceneToTest.prefab │ ├── DragThisToYourSceneToTest.prefab.meta │ ├── TapInputTest.cs │ └── TapInputTest.cs.meta │ ├── WindowsStandalone.meta │ ├── WindowsStandalone │ ├── TAPInputStandaloneWin.cs │ ├── TAPInputStandaloneWin.cs.meta │ ├── TAPWin.dll │ └── TAPWin.dll.meta │ ├── iOS.meta │ └── iOS │ ├── TAPKitUnityBridge.framework.meta │ ├── TAPKitUnityBridge.framework │ ├── .DS_Store │ ├── Frameworks │ │ ├── .DS_Store │ │ └── TAPKit.framework │ │ │ ├── Info.plist │ │ │ ├── TAPKit │ │ │ └── _CodeSignature │ │ │ └── CodeResources │ ├── Headers │ │ └── TAPKitUnityBridge.h │ ├── Info.plist │ ├── Modules │ │ └── module.modulemap │ ├── TAPKitUnityBridge │ └── _CodeSignature │ │ └── CodeResources │ ├── TapInputIOS.cs │ └── TapInputIOS.cs.meta ├── LICENSE ├── Logs └── Packages-Update.log ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Packages │ └── com.unity.services.core │ │ └── Settings.json ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── SceneTemplateSettings.json ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── VersionControlSettings.asset ├── README.md └── tap-unity-plugin.unitypackage /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Asset meta data should only be ignored when the corresponding asset is also ignored 18 | !/[Aa]ssets/**/*.meta 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | 61 | # Crashlytics generated file 62 | crashlytics-build.properties 63 | -------------------------------------------------------------------------------- /.gradle/4.6/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/4.6/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/.gradle/4.6/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/4.6/taskHistory/taskHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/.gradle/4.6/taskHistory/taskHistory.lock -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Tue Dec 31 10:32:26 IST 2019 2 | gradle.version=4.6 3 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitmodules":true, 7 | "**/*.booproj":true, 8 | "**/*.pidb":true, 9 | "**/*.suo":true, 10 | "**/*.user":true, 11 | "**/*.userprefs":true, 12 | "**/*.unityproj":true, 13 | "**/*.dll":true, 14 | "**/*.exe":true, 15 | "**/*.pdf":true, 16 | "**/*.mid":true, 17 | "**/*.midi":true, 18 | "**/*.wav":true, 19 | "**/*.gif":true, 20 | "**/*.ico":true, 21 | "**/*.jpg":true, 22 | "**/*.jpeg":true, 23 | "**/*.png":true, 24 | "**/*.psd":true, 25 | "**/*.tga":true, 26 | "**/*.tif":true, 27 | "**/*.tiff":true, 28 | "**/*.3ds":true, 29 | "**/*.3DS":true, 30 | "**/*.fbx":true, 31 | "**/*.FBX":true, 32 | "**/*.lxo":true, 33 | "**/*.LXO":true, 34 | "**/*.ma":true, 35 | "**/*.MA":true, 36 | "**/*.obj":true, 37 | "**/*.OBJ":true, 38 | "**/*.asset":true, 39 | "**/*.cubemap":true, 40 | "**/*.flare":true, 41 | "**/*.mat":true, 42 | "**/*.meta":true, 43 | "**/*.prefab":true, 44 | "**/*.unity":true, 45 | "build/":true, 46 | "Build/":true, 47 | "Library/":true, 48 | "library/":true, 49 | "obj/":true, 50 | "Obj/":true, 51 | "ProjectSettings/":true, 52 | "temp/":true, 53 | "Temp/":true 54 | } 55 | } -------------------------------------------------------------------------------- /.vsconfig: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1.0", 3 | "components": [ 4 | "Microsoft.VisualStudio.Workload.ManagedGame" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /Assets/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/.DS_Store -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 551fc11cb7d724aa08a4e14c24558931 3 | folderAsset: yes 4 | timeCreated: 1551707490 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Editor/TAP.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ea2ba1b4696348de803ed2197d4e7b1 3 | folderAsset: yes 4 | timeCreated: 1551707500 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Editor/TAP/TAPPostProcess.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using UnityEngine; 3 | using UnityEditor; 4 | #if UNITY_IOS 5 | using UnityEditor.iOS.Xcode; 6 | using UnityEditor.iOS.Xcode.Extensions; 7 | #endif 8 | using UnityEditor.Callbacks; 9 | using System.Collections; 10 | 11 | public class TAPPostProcess { 12 | 13 | #if UNITY_IOS 14 | [PostProcessBuildAttribute(0)] 15 | public static void OnPostprocessBuild (BuildTarget buildTarget, string pathToBuiltProject) 16 | { 17 | if (buildTarget != BuildTarget.iOS) { 18 | return; 19 | } 20 | 21 | Debug.Log ("TAP PostProcessBuild projectPath = " + pathToBuiltProject); 22 | // Initialize PbxProject 23 | var projectPath = pathToBuiltProject + "/Unity-iPhone.xcodeproj/project.pbxproj"; 24 | PBXProject pbxProject = new PBXProject (); 25 | pbxProject.ReadFromFile (projectPath); 26 | //string targetGuid = pbxProject.TargetGuidByName ("Unity-iPhone"); 27 | string targetGuid = pbxProject.GetUnityMainTargetGuid(); 28 | Debug.Log ("TAP PostProcessBuild pbxproject initialized"); 29 | 30 | pbxProject.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO"); 31 | pbxProject.SetBuildProperty (targetGuid, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "YES"); 32 | 33 | Debug.Log ("TAP PostProcessBuild pbxproject set properties"); 34 | 35 | string unityBridgeFrameworkPath = "Frameworks/TAP/iOS/TAPKitUnityBridge.framework"; 36 | string guidTAPKitUnityBridge = pbxProject.FindFileGuidByProjectPath (unityBridgeFrameworkPath); 37 | if (guidTAPKitUnityBridge != null && guidTAPKitUnityBridge != "") { 38 | pbxProject.AddFileToEmbedFrameworks (targetGuid, guidTAPKitUnityBridge); 39 | } else { 40 | Debug.LogError ("Error adding TAPKitUnityBridge to embed frameworks"); 41 | } 42 | 43 | //string unityBridgeFrameworkPath = "Frameworks/TAP/iOS/TAPKit.framework"; 44 | //string guidTAPKitUnityBridge = pbxProject.FindFileGuidByProjectPath(unityBridgeFrameworkPath); 45 | //if (guidTAPKitUnityBridge != null && guidTAPKitUnityBridge != "") 46 | //{ 47 | // pbxProject.AddFileToEmbedFrameworks(targetGuid, guidTAPKitUnityBridge); 48 | //} 49 | //else 50 | //{ 51 | // Debug.LogError("Error adding TAPKitUnityBridge to embed frameworks"); 52 | //} 53 | 54 | 55 | 56 | //string FrameworksPluginsPath = "Frameworks/TAP/iOS/"; 57 | /* 58 | // Add embed frameworks : 59 | string FrameworksPluginsPath = "Plugins/iOS/TAP"; 60 | // string TAPKitFrameworkName = "TAPKit.framework"; 61 | string TAPKitUnityBridgeFrameworkName = "TAPKitUnityBridge.framework"; 62 | 63 | 64 | 65 | 66 | // string guidTAPKit = pbxProject.FindFileGuidByProjectPath ("Frameworks/" + FrameworksPluginsPath + "/" + TAPKitFrameworkName); 67 | //string guidTAPKitUnityBridge = pbxProject.FindFileGuidByProjectPath ("Frameworks/" + FrameworksPluginsPath + "/" + TAPKitUnityBridgeFrameworkName); 68 | string guidTAPKitUnityBridge = pbxProject.FindFileGuidByProjectPath ("Frameworks/" + FrameworksPluginsPath + "/" + TAPKitUnityBridgeFrameworkName); 69 | 70 | Debug.Log ("TAP PostProcessBuild TAPKitUnityBridge guid = " + guidTAPKitUnityBridge); 71 | // if (guidTAPKit == "") { 72 | // Debug.LogError (TAPKitFrameworkName + " Framework not found. make sure it's in the correct folder: " + FrameworksPluginsPath); 73 | // } else 74 | 75 | if (guidTAPKitUnityBridge == null || (guidTAPKitUnityBridge != null && guidTAPKitUnityBridge == "")) { 76 | Debug.LogError (TAPKitUnityBridgeFrameworkName + " Framework not found. make sure it's in the correct folder: " + FrameworksPluginsPath); 77 | } else { 78 | // pbxProject.AddFileToEmbedFrameworks (targetGuid, guidTAPKit); 79 | pbxProject.AddFileToEmbedFrameworks (targetGuid, guidTAPKitUnityBridge); 80 | Debug.Log ("TAP PostProcessBuild pbxproject Added embed frameworks"); 81 | } 82 | */ 83 | File.WriteAllText (projectPath, pbxProject.WriteToString ()); 84 | } 85 | 86 | #endif 87 | 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /Assets/Editor/TAP/TAPPostProcess.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3b318d129df740d5920d0dc555590d7 3 | timeCreated: 1551707506 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f06d050d120c49cf97dec6b9f8aba54 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Resources/BillingMode.json: -------------------------------------------------------------------------------- 1 | {"androidStore":"GooglePlay"} -------------------------------------------------------------------------------- /Assets/Resources/BillingMode.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5178de4a214ba40c99b199dc38a3e946 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ee952128c98449499af12beca84daa8 3 | folderAsset: yes 4 | timeCreated: 1551707556 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scenes/TAPTestScene.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: 3 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 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, g: 0, b: 0, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 12 47 | m_GIWorkflowMode: 1 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: 0 55 | m_EnableRealtimeLightmaps: 0 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_LightingSettings: {fileID: 4890085278179872738, guid: 59e09ac12bb164e4c98e9c6a9a050cd2, 102 | type: 2} 103 | --- !u!196 &4 104 | NavMeshSettings: 105 | serializedVersion: 2 106 | m_ObjectHideFlags: 0 107 | m_BuildSettings: 108 | serializedVersion: 3 109 | agentTypeID: 0 110 | agentRadius: 0.5 111 | agentHeight: 2 112 | agentSlope: 45 113 | agentClimb: 0.4 114 | ledgeDropHeight: 0 115 | maxJumpAcrossDistance: 0 116 | minRegionArea: 2 117 | manualCellSize: 0 118 | cellSize: 0.16666667 119 | manualTileSize: 0 120 | tileSize: 256 121 | buildHeightMesh: 0 122 | maxJobWorkers: 0 123 | preserveTilesOutsideBounds: 0 124 | debug: 125 | m_Flags: 0 126 | m_NavMeshData: {fileID: 0} 127 | --- !u!1 &531501432 128 | GameObject: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | serializedVersion: 6 134 | m_Component: 135 | - component: {fileID: 531501435} 136 | - component: {fileID: 531501434} 137 | - component: {fileID: 531501433} 138 | m_Layer: 0 139 | m_Name: EventSystem 140 | m_TagString: Untagged 141 | m_Icon: {fileID: 0} 142 | m_NavMeshLayer: 0 143 | m_StaticEditorFlags: 0 144 | m_IsActive: 1 145 | --- !u!114 &531501433 146 | MonoBehaviour: 147 | m_ObjectHideFlags: 0 148 | m_CorrespondingSourceObject: {fileID: 0} 149 | m_PrefabInstance: {fileID: 0} 150 | m_PrefabAsset: {fileID: 0} 151 | m_GameObject: {fileID: 531501432} 152 | m_Enabled: 1 153 | m_EditorHideFlags: 0 154 | m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} 155 | m_Name: 156 | m_EditorClassIdentifier: 157 | m_SendPointerHoverToParent: 1 158 | m_HorizontalAxis: Horizontal 159 | m_VerticalAxis: Vertical 160 | m_SubmitButton: Submit 161 | m_CancelButton: Cancel 162 | m_InputActionsPerSecond: 10 163 | m_RepeatDelay: 0.5 164 | m_ForceModuleActive: 0 165 | --- !u!114 &531501434 166 | MonoBehaviour: 167 | m_ObjectHideFlags: 0 168 | m_CorrespondingSourceObject: {fileID: 0} 169 | m_PrefabInstance: {fileID: 0} 170 | m_PrefabAsset: {fileID: 0} 171 | m_GameObject: {fileID: 531501432} 172 | m_Enabled: 1 173 | m_EditorHideFlags: 0 174 | m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} 175 | m_Name: 176 | m_EditorClassIdentifier: 177 | m_FirstSelected: {fileID: 0} 178 | m_sendNavigationEvents: 1 179 | m_DragThreshold: 5 180 | --- !u!4 &531501435 181 | Transform: 182 | m_ObjectHideFlags: 0 183 | m_CorrespondingSourceObject: {fileID: 0} 184 | m_PrefabInstance: {fileID: 0} 185 | m_PrefabAsset: {fileID: 0} 186 | m_GameObject: {fileID: 531501432} 187 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 188 | m_LocalPosition: {x: 0, y: 0, z: 0} 189 | m_LocalScale: {x: 1, y: 1, z: 1} 190 | m_ConstrainProportionsScale: 0 191 | m_Children: [] 192 | m_Father: {fileID: 0} 193 | m_RootOrder: 2 194 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 195 | --- !u!1001 &1230662903 196 | PrefabInstance: 197 | m_ObjectHideFlags: 0 198 | serializedVersion: 2 199 | m_Modification: 200 | serializedVersion: 3 201 | m_TransformParent: {fileID: 0} 202 | m_Modifications: 203 | - target: {fileID: 4380301765117352, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 204 | propertyPath: m_RootOrder 205 | value: 3 206 | objectReference: {fileID: 0} 207 | - target: {fileID: 4380301765117352, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 208 | propertyPath: m_LocalPosition.x 209 | value: 0 210 | objectReference: {fileID: 0} 211 | - target: {fileID: 4380301765117352, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 212 | propertyPath: m_LocalPosition.y 213 | value: 0 214 | objectReference: {fileID: 0} 215 | - target: {fileID: 4380301765117352, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 216 | propertyPath: m_LocalPosition.z 217 | value: 0 218 | objectReference: {fileID: 0} 219 | - target: {fileID: 4380301765117352, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 220 | propertyPath: m_LocalRotation.w 221 | value: 1 222 | objectReference: {fileID: 0} 223 | - target: {fileID: 4380301765117352, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 224 | propertyPath: m_LocalRotation.x 225 | value: 0 226 | objectReference: {fileID: 0} 227 | - target: {fileID: 4380301765117352, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 228 | propertyPath: m_LocalRotation.y 229 | value: 0 230 | objectReference: {fileID: 0} 231 | - target: {fileID: 4380301765117352, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 232 | propertyPath: m_LocalRotation.z 233 | value: 0 234 | objectReference: {fileID: 0} 235 | - target: {fileID: 114087754655917132, guid: ae7cad239a3d9405a8bb18c6a306d7da, 236 | type: 3} 237 | propertyPath: LogText 238 | value: 239 | objectReference: {fileID: 2099359961} 240 | m_RemovedComponents: [] 241 | m_RemovedGameObjects: [] 242 | m_AddedGameObjects: [] 243 | m_AddedComponents: [] 244 | m_SourcePrefab: {fileID: 100100000, guid: ae7cad239a3d9405a8bb18c6a306d7da, type: 3} 245 | --- !u!1 &1566603360 246 | GameObject: 247 | m_ObjectHideFlags: 0 248 | m_CorrespondingSourceObject: {fileID: 0} 249 | m_PrefabInstance: {fileID: 0} 250 | m_PrefabAsset: {fileID: 0} 251 | serializedVersion: 6 252 | m_Component: 253 | - component: {fileID: 1566603362} 254 | - component: {fileID: 1566603361} 255 | m_Layer: 0 256 | m_Name: AndroidPermissions 257 | m_TagString: Untagged 258 | m_Icon: {fileID: 0} 259 | m_NavMeshLayer: 0 260 | m_StaticEditorFlags: 0 261 | m_IsActive: 1 262 | --- !u!114 &1566603361 263 | MonoBehaviour: 264 | m_ObjectHideFlags: 0 265 | m_CorrespondingSourceObject: {fileID: 0} 266 | m_PrefabInstance: {fileID: 0} 267 | m_PrefabAsset: {fileID: 0} 268 | m_GameObject: {fileID: 1566603360} 269 | m_Enabled: 1 270 | m_EditorHideFlags: 0 271 | m_Script: {fileID: 11500000, guid: 51ae9c43b1224427cb3bd7e1a5a49eb5, type: 3} 272 | m_Name: 273 | m_EditorClassIdentifier: 274 | --- !u!4 &1566603362 275 | Transform: 276 | m_ObjectHideFlags: 0 277 | m_CorrespondingSourceObject: {fileID: 0} 278 | m_PrefabInstance: {fileID: 0} 279 | m_PrefabAsset: {fileID: 0} 280 | m_GameObject: {fileID: 1566603360} 281 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 282 | m_LocalPosition: {x: 0, y: 0, z: 0} 283 | m_LocalScale: {x: 1, y: 1, z: 1} 284 | m_ConstrainProportionsScale: 0 285 | m_Children: [] 286 | m_Father: {fileID: 0} 287 | m_RootOrder: 4 288 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 289 | --- !u!1 &1734352483 290 | GameObject: 291 | m_ObjectHideFlags: 0 292 | m_CorrespondingSourceObject: {fileID: 0} 293 | m_PrefabInstance: {fileID: 0} 294 | m_PrefabAsset: {fileID: 0} 295 | serializedVersion: 6 296 | m_Component: 297 | - component: {fileID: 1734352484} 298 | - component: {fileID: 1734352487} 299 | - component: {fileID: 1734352486} 300 | - component: {fileID: 1734352485} 301 | m_Layer: 5 302 | m_Name: Canvas 303 | m_TagString: Untagged 304 | m_Icon: {fileID: 0} 305 | m_NavMeshLayer: 0 306 | m_StaticEditorFlags: 0 307 | m_IsActive: 1 308 | --- !u!224 &1734352484 309 | RectTransform: 310 | m_ObjectHideFlags: 0 311 | m_CorrespondingSourceObject: {fileID: 0} 312 | m_PrefabInstance: {fileID: 0} 313 | m_PrefabAsset: {fileID: 0} 314 | m_GameObject: {fileID: 1734352483} 315 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 316 | m_LocalPosition: {x: 0, y: 0, z: 0} 317 | m_LocalScale: {x: 0, y: 0, z: 0} 318 | m_ConstrainProportionsScale: 0 319 | m_Children: 320 | - {fileID: 2099359963} 321 | m_Father: {fileID: 0} 322 | m_RootOrder: 1 323 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 324 | m_AnchorMin: {x: 0, y: 0} 325 | m_AnchorMax: {x: 0, y: 0} 326 | m_AnchoredPosition: {x: 0, y: 0} 327 | m_SizeDelta: {x: 0, y: 0} 328 | m_Pivot: {x: 0, y: 0} 329 | --- !u!114 &1734352485 330 | MonoBehaviour: 331 | m_ObjectHideFlags: 0 332 | m_CorrespondingSourceObject: {fileID: 0} 333 | m_PrefabInstance: {fileID: 0} 334 | m_PrefabAsset: {fileID: 0} 335 | m_GameObject: {fileID: 1734352483} 336 | m_Enabled: 1 337 | m_EditorHideFlags: 0 338 | m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} 339 | m_Name: 340 | m_EditorClassIdentifier: 341 | m_IgnoreReversedGraphics: 1 342 | m_BlockingObjects: 0 343 | m_BlockingMask: 344 | serializedVersion: 2 345 | m_Bits: 4294967295 346 | --- !u!114 &1734352486 347 | MonoBehaviour: 348 | m_ObjectHideFlags: 0 349 | m_CorrespondingSourceObject: {fileID: 0} 350 | m_PrefabInstance: {fileID: 0} 351 | m_PrefabAsset: {fileID: 0} 352 | m_GameObject: {fileID: 1734352483} 353 | m_Enabled: 1 354 | m_EditorHideFlags: 0 355 | m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} 356 | m_Name: 357 | m_EditorClassIdentifier: 358 | m_UiScaleMode: 1 359 | m_ReferencePixelsPerUnit: 100 360 | m_ScaleFactor: 1 361 | m_ReferenceResolution: {x: 800, y: 600} 362 | m_ScreenMatchMode: 2 363 | m_MatchWidthOrHeight: 0 364 | m_PhysicalUnit: 3 365 | m_FallbackScreenDPI: 96 366 | m_DefaultSpriteDPI: 96 367 | m_DynamicPixelsPerUnit: 1 368 | m_PresetInfoIsWorld: 0 369 | --- !u!223 &1734352487 370 | Canvas: 371 | m_ObjectHideFlags: 0 372 | m_CorrespondingSourceObject: {fileID: 0} 373 | m_PrefabInstance: {fileID: 0} 374 | m_PrefabAsset: {fileID: 0} 375 | m_GameObject: {fileID: 1734352483} 376 | m_Enabled: 1 377 | serializedVersion: 3 378 | m_RenderMode: 1 379 | m_Camera: {fileID: 0} 380 | m_PlaneDistance: 100 381 | m_PixelPerfect: 0 382 | m_ReceivesEvents: 1 383 | m_OverrideSorting: 0 384 | m_OverridePixelPerfect: 0 385 | m_SortingBucketNormalizedSize: 0 386 | m_AdditionalShaderChannelsFlag: 0 387 | m_UpdateRectTransformForStandalone: 0 388 | m_SortingLayerID: 0 389 | m_SortingOrder: 0 390 | m_TargetDisplay: 0 391 | --- !u!1 &2099359960 392 | GameObject: 393 | m_ObjectHideFlags: 0 394 | m_CorrespondingSourceObject: {fileID: 0} 395 | m_PrefabInstance: {fileID: 0} 396 | m_PrefabAsset: {fileID: 0} 397 | serializedVersion: 6 398 | m_Component: 399 | - component: {fileID: 2099359963} 400 | - component: {fileID: 2099359962} 401 | - component: {fileID: 2099359961} 402 | m_Layer: 5 403 | m_Name: Text 404 | m_TagString: Untagged 405 | m_Icon: {fileID: 0} 406 | m_NavMeshLayer: 0 407 | m_StaticEditorFlags: 0 408 | m_IsActive: 1 409 | --- !u!114 &2099359961 410 | MonoBehaviour: 411 | m_ObjectHideFlags: 0 412 | m_CorrespondingSourceObject: {fileID: 0} 413 | m_PrefabInstance: {fileID: 0} 414 | m_PrefabAsset: {fileID: 0} 415 | m_GameObject: {fileID: 2099359960} 416 | m_Enabled: 1 417 | m_EditorHideFlags: 0 418 | m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} 419 | m_Name: 420 | m_EditorClassIdentifier: 421 | m_Material: {fileID: 0} 422 | m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} 423 | m_RaycastTarget: 1 424 | m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} 425 | m_Maskable: 1 426 | m_OnCullStateChanged: 427 | m_PersistentCalls: 428 | m_Calls: [] 429 | m_FontData: 430 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 431 | m_FontSize: 14 432 | m_FontStyle: 0 433 | m_BestFit: 0 434 | m_MinSize: 10 435 | m_MaxSize: 40 436 | m_Alignment: 1 437 | m_AlignByGeometry: 0 438 | m_RichText: 1 439 | m_HorizontalOverflow: 0 440 | m_VerticalOverflow: 0 441 | m_LineSpacing: 1 442 | m_Text: New Text 443 | --- !u!222 &2099359962 444 | CanvasRenderer: 445 | m_ObjectHideFlags: 0 446 | m_CorrespondingSourceObject: {fileID: 0} 447 | m_PrefabInstance: {fileID: 0} 448 | m_PrefabAsset: {fileID: 0} 449 | m_GameObject: {fileID: 2099359960} 450 | m_CullTransparentMesh: 0 451 | --- !u!224 &2099359963 452 | RectTransform: 453 | m_ObjectHideFlags: 0 454 | m_CorrespondingSourceObject: {fileID: 0} 455 | m_PrefabInstance: {fileID: 0} 456 | m_PrefabAsset: {fileID: 0} 457 | m_GameObject: {fileID: 2099359960} 458 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 459 | m_LocalPosition: {x: 0, y: 0, z: 0} 460 | m_LocalScale: {x: 1, y: 1, z: 1} 461 | m_ConstrainProportionsScale: 0 462 | m_Children: [] 463 | m_Father: {fileID: 1734352484} 464 | m_RootOrder: 0 465 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 466 | m_AnchorMin: {x: 0, y: 0} 467 | m_AnchorMax: {x: 1, y: 0.85} 468 | m_AnchoredPosition: {x: 0, y: 0} 469 | m_SizeDelta: {x: 0, y: 0} 470 | m_Pivot: {x: 0.5, y: 0.5} 471 | --- !u!1 &2110253996 472 | GameObject: 473 | m_ObjectHideFlags: 0 474 | m_CorrespondingSourceObject: {fileID: 0} 475 | m_PrefabInstance: {fileID: 0} 476 | m_PrefabAsset: {fileID: 0} 477 | serializedVersion: 6 478 | m_Component: 479 | - component: {fileID: 2110254000} 480 | - component: {fileID: 2110253999} 481 | - component: {fileID: 2110253998} 482 | - component: {fileID: 2110253997} 483 | m_Layer: 0 484 | m_Name: Main Camera 485 | m_TagString: MainCamera 486 | m_Icon: {fileID: 0} 487 | m_NavMeshLayer: 0 488 | m_StaticEditorFlags: 0 489 | m_IsActive: 1 490 | --- !u!81 &2110253997 491 | AudioListener: 492 | m_ObjectHideFlags: 0 493 | m_CorrespondingSourceObject: {fileID: 0} 494 | m_PrefabInstance: {fileID: 0} 495 | m_PrefabAsset: {fileID: 0} 496 | m_GameObject: {fileID: 2110253996} 497 | m_Enabled: 1 498 | --- !u!124 &2110253998 499 | Behaviour: 500 | m_ObjectHideFlags: 0 501 | m_CorrespondingSourceObject: {fileID: 0} 502 | m_PrefabInstance: {fileID: 0} 503 | m_PrefabAsset: {fileID: 0} 504 | m_GameObject: {fileID: 2110253996} 505 | m_Enabled: 1 506 | --- !u!20 &2110253999 507 | Camera: 508 | m_ObjectHideFlags: 0 509 | m_CorrespondingSourceObject: {fileID: 0} 510 | m_PrefabInstance: {fileID: 0} 511 | m_PrefabAsset: {fileID: 0} 512 | m_GameObject: {fileID: 2110253996} 513 | m_Enabled: 1 514 | serializedVersion: 2 515 | m_ClearFlags: 1 516 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 517 | m_projectionMatrixMode: 1 518 | m_GateFitMode: 2 519 | m_FOVAxisMode: 0 520 | m_Iso: 200 521 | m_ShutterSpeed: 0.005 522 | m_Aperture: 16 523 | m_FocusDistance: 10 524 | m_FocalLength: 50 525 | m_BladeCount: 5 526 | m_Curvature: {x: 2, y: 11} 527 | m_BarrelClipping: 0.25 528 | m_Anamorphism: 0 529 | m_SensorSize: {x: 36, y: 24} 530 | m_LensShift: {x: 0, y: 0} 531 | m_NormalizedViewPortRect: 532 | serializedVersion: 2 533 | x: 0 534 | y: 0 535 | width: 1 536 | height: 1 537 | near clip plane: 0.3 538 | far clip plane: 1000 539 | field of view: 60 540 | orthographic: 1 541 | orthographic size: 5 542 | m_Depth: -1 543 | m_CullingMask: 544 | serializedVersion: 2 545 | m_Bits: 4294967295 546 | m_RenderingPath: -1 547 | m_TargetTexture: {fileID: 0} 548 | m_TargetDisplay: 0 549 | m_TargetEye: 3 550 | m_HDR: 1 551 | m_AllowMSAA: 1 552 | m_AllowDynamicResolution: 0 553 | m_ForceIntoRT: 0 554 | m_OcclusionCulling: 1 555 | m_StereoConvergence: 10 556 | m_StereoSeparation: 0.022 557 | --- !u!4 &2110254000 558 | Transform: 559 | m_ObjectHideFlags: 0 560 | m_CorrespondingSourceObject: {fileID: 0} 561 | m_PrefabInstance: {fileID: 0} 562 | m_PrefabAsset: {fileID: 0} 563 | m_GameObject: {fileID: 2110253996} 564 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 565 | m_LocalPosition: {x: 0, y: 0, z: -10} 566 | m_LocalScale: {x: 1, y: 1, z: 1} 567 | m_ConstrainProportionsScale: 0 568 | m_Children: [] 569 | m_Father: {fileID: 0} 570 | m_RootOrder: 0 571 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 572 | -------------------------------------------------------------------------------- /Assets/Scenes/TAPTestScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b0e9e4ed2b6241759bb123270ecc2bc 3 | timeCreated: 1551707737 4 | licenseType: Pro 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/TAPTestSceneSettings.lighting: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!850595691 &4890085278179872738 4 | LightingSettings: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_Name: TAPTestSceneSettings 10 | serializedVersion: 6 11 | m_GIWorkflowMode: 1 12 | m_EnableBakedLightmaps: 0 13 | m_EnableRealtimeLightmaps: 0 14 | m_RealtimeEnvironmentLighting: 1 15 | m_BounceScale: 1 16 | m_AlbedoBoost: 1 17 | m_IndirectOutputScale: 1 18 | m_UsingShadowmask: 1 19 | m_BakeBackend: 0 20 | m_LightmapMaxSize: 1024 21 | m_BakeResolution: 40 22 | m_Padding: 2 23 | m_LightmapCompression: 3 24 | m_AO: 0 25 | m_AOMaxDistance: 1 26 | m_CompAOExponent: 1 27 | m_CompAOExponentDirect: 0 28 | m_ExtractAO: 0 29 | m_MixedBakeMode: 2 30 | m_LightmapsBakeMode: 1 31 | m_FilterMode: 1 32 | m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0} 33 | m_ExportTrainingData: 0 34 | m_TrainingDataDestination: TrainingData 35 | m_RealtimeResolution: 2 36 | m_ForceWhiteAlbedo: 0 37 | m_ForceUpdates: 0 38 | m_FinalGather: 0 39 | m_FinalGatherRayCount: 256 40 | m_FinalGatherFiltering: 1 41 | m_PVRCulling: 1 42 | m_PVRSampling: 1 43 | m_PVRDirectSampleCount: 32 44 | m_PVRSampleCount: 512 45 | m_PVREnvironmentSampleCount: 512 46 | m_PVREnvironmentReferencePointCount: 2048 47 | m_LightProbeSampleCountMultiplier: 4 48 | m_PVRBounces: 2 49 | m_PVRMinBounces: 2 50 | m_PVREnvironmentImportanceSampling: 0 51 | m_PVRFilteringMode: 2 52 | m_PVRDenoiserTypeDirect: 0 53 | m_PVRDenoiserTypeIndirect: 0 54 | m_PVRDenoiserTypeAO: 0 55 | m_PVRFilterTypeDirect: 0 56 | m_PVRFilterTypeIndirect: 0 57 | m_PVRFilterTypeAO: 0 58 | m_PVRFilteringGaussRadiusDirect: 1 59 | m_PVRFilteringGaussRadiusIndirect: 5 60 | m_PVRFilteringGaussRadiusAO: 2 61 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 62 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 63 | m_PVRFilteringAtrousPositionSigmaAO: 1 64 | m_PVRTiledBaking: 0 65 | m_NumRaysToShootPerTexel: -1 66 | m_RespectSceneVisibilityWhenBakingGI: 0 67 | -------------------------------------------------------------------------------- /Assets/Scenes/TAPTestSceneSettings.lighting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59e09ac12bb164e4c98e9c6a9a050cd2 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 4890085278179872738 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bad89ac4b368844b4854303518f3324b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/AndroidPermissions.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Android; 5 | 6 | 7 | public class AndroidPermissions : MonoBehaviour 8 | { 9 | // Start is called before the first frame update 10 | void Start() 11 | { 12 | 13 | #if UNITY_ANDROID 14 | if (!Permission.HasUserAuthorizedPermission("android.permission.BLUETOOTH_CONNECT")) 15 | { 16 | Permission.RequestUserPermission("android.permission.BLUETOOTH_CONNECT"); 17 | } 18 | 19 | 20 | if (!Permission.HasUserAuthorizedPermission("android.permission.BLUETOOTH_ADMIN")) 21 | { 22 | Permission.RequestUserPermission("android.permission.BLUETOOTH_ADMIN"); 23 | } 24 | 25 | 26 | #endif 27 | } 28 | 29 | // Update is called once per frame 30 | void Update() 31 | { 32 | 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Assets/Scripts/AndroidPermissions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51ae9c43b1224427cb3bd7e1a5a49eb5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/TAP.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e66428251bab74baab6c77aab9e1856a 3 | folderAsset: yes 4 | timeCreated: 1551707539 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/TAP/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/.DS_Store -------------------------------------------------------------------------------- /Assets/TAP/Android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd7e199d3cd8f4e42954fa4e04524cf6 3 | folderAsset: yes 4 | timeCreated: 1551707568 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/TAP/Android/TapInputAndroid.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_ANDROID && !UNITY_EDITOR 2 | 3 | using UnityEngine; 4 | using System; 5 | 6 | public class TapInputAndroid : Singleton, ITapInput { 7 | 8 | public const int MODE_TEXT = 1; 9 | public const int MODE_CONTROLLER = 2; 10 | 11 | private const Char ARGS_SEPERATOR = '|'; 12 | 13 | public event Action OnBluetoothTurnedOn; 14 | public event Action OnBluetoothTurnedOff; 15 | public event Action OnTapConnected; 16 | public event Action OnTapDisconnected; 17 | public event Action OnControllerModeStarted; 18 | public event Action OnTextModeStarted; 19 | public event Action OnTapInputReceived; 20 | public event Action OnMouseInputReceived; 21 | public event Action OnConnectedTapsReceived; 22 | public event Action OnModeReceived; 23 | public event Action OnAirGestureInputReceived; 24 | public event Action OnTapChangedAirGestureState; 25 | public event Action OnRawSensorDataReceived; 26 | 27 | private AndroidJavaObject tapUnityAdapter; 28 | 29 | public override void OnInit() 30 | { 31 | AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); 32 | AndroidJavaObject currentActivity = unityPlayer.GetStatic("currentActivity"); 33 | AndroidJavaObject context = currentActivity.Call("getApplicationContext"); 34 | 35 | tapUnityAdapter = new AndroidJavaObject("com.tapwithus.tapunity.TapUnityAdapter", context); 36 | tapUnityAdapter.Call("resume"); 37 | } 38 | 39 | private void OnApplicationPause(bool isPaused) { 40 | if (isPaused) { 41 | tapUnityAdapter.Call ("pause"); 42 | } else { 43 | tapUnityAdapter.Call ("resume"); 44 | } 45 | } 46 | 47 | private void OnDestroy() 48 | { 49 | tapUnityAdapter.Call ("destroy"); 50 | } 51 | 52 | public void EnableDebug() 53 | { 54 | tapUnityAdapter.Call ("enableDebug"); 55 | } 56 | 57 | public void DisableDebug() 58 | { 59 | tapUnityAdapter.Call ("disableDebug"); 60 | } 61 | 62 | public void StartControllerMode(string tapIdentifier) 63 | { 64 | tapUnityAdapter.Call ("startControllerMode", tapIdentifier); 65 | } 66 | 67 | public void StartTextMode(string tapIdentifier) 68 | { 69 | tapUnityAdapter.Call ("startTextMode", tapIdentifier); 70 | 71 | } 72 | 73 | private void onBluetoothTurnedOn() { 74 | if (OnBluetoothTurnedOn != null) { 75 | OnBluetoothTurnedOn (); 76 | } 77 | } 78 | 79 | private void onBluetoothTurnedOff() { 80 | if (OnBluetoothTurnedOff != null) { 81 | OnBluetoothTurnedOff (); 82 | } 83 | } 84 | 85 | private void onTapConnected(string tapIdentifier) 86 | { 87 | tapUnityAdapter.Call ("getCachedTap", tapIdentifier); 88 | } 89 | 90 | private void onTapDisconnected(string tapIdentifier) 91 | { 92 | if (OnTapDisconnected != null) { 93 | OnTapDisconnected (tapIdentifier); 94 | } 95 | } 96 | 97 | private void onCachedTapRetrieved(string args) 98 | { 99 | if (OnTapConnected != null) 100 | { 101 | string[] argParts = args.Split(ARGS_SEPERATOR); 102 | 103 | int d = 0; 104 | Int32.TryParse(argParts[5], out d); 105 | 106 | OnTapConnected(argParts[0], argParts[1], d); 107 | } 108 | } 109 | 110 | private void onControllerModeStarted(string tapIdentifier) { 111 | if (OnControllerModeStarted != null) { 112 | OnControllerModeStarted (tapIdentifier); 113 | } 114 | } 115 | 116 | private void onTextModeStarted(string tapIdentifier) { 117 | if (OnTextModeStarted != null) { 118 | OnTextModeStarted (tapIdentifier); 119 | } 120 | } 121 | 122 | private void onTapInputReceived(string args) 123 | { 124 | if (OnTapInputReceived != null) { 125 | string[] argParts = args.Split (ARGS_SEPERATOR); 126 | 127 | int d = 0; 128 | Int32.TryParse (argParts[1], out d); 129 | 130 | OnTapInputReceived (argParts[0], d); 131 | } 132 | } 133 | 134 | private void onMouseInputReceived(string args) 135 | { 136 | Debug.Log("--------MOUSE INPUT RECEIVED"); 137 | if (OnMouseInputReceived != null) { 138 | string[] argParts = args.Split (ARGS_SEPERATOR); 139 | 140 | int dx = 0; 141 | Int32.TryParse (argParts[1], out dx); 142 | 143 | int dy = 0; 144 | Int32.TryParse (argParts[2], out dy); 145 | 146 | int p = 0; 147 | Int32.TryParse(argParts[3], out p); 148 | 149 | OnMouseInputReceived (argParts [0], dx, dy, p != 0); 150 | } 151 | } 152 | 153 | private void onConnectedTapsReceived(String tapsArg) 154 | { 155 | if (OnConnectedTapsReceived != null) { 156 | string[] taps = tapsArg.Split (ARGS_SEPERATOR); 157 | 158 | OnConnectedTapsReceived (taps); 159 | } 160 | } 161 | 162 | private void onModeReceived(String modeArg) 163 | { 164 | if (OnModeReceived != null) { 165 | string[] argParts = modeArg.Split (ARGS_SEPERATOR); 166 | int mode = 0; 167 | Int32.TryParse (argParts[1], out mode); 168 | OnModeReceived(argParts[0], mode); 169 | } 170 | } 171 | 172 | private void onRawSensorDataReceived(String rsArg) 173 | { 174 | if (OnRawSensorDataReceived != null) 175 | { 176 | string[] argParts = rsArg.Split(ARGS_SEPERATOR); 177 | if (argParts.Length == 2) 178 | { 179 | RawSensorData data = RawSensorData.makeFromString(argParts[1], "^"); 180 | if (data != null) 181 | { 182 | OnRawSensorDataReceived(argParts[0], data); 183 | } 184 | } 185 | } 186 | } 187 | 188 | 189 | private void onAirGestureInputReceived(String args) 190 | { 191 | if (OnAirGestureInputReceived != null) 192 | { 193 | string[] argParts = args.Split(ARGS_SEPERATOR); 194 | if (argParts.Length >= 2) 195 | { 196 | int gesture = 0; 197 | if (Int32.TryParse(argParts[1], out gesture)) 198 | { 199 | if (Enum.IsDefined(typeof(TapAirGesture), gesture)) 200 | { 201 | OnAirGestureInputReceived(argParts[0], (TapAirGesture)gesture); 202 | } 203 | } 204 | } 205 | 206 | } 207 | } 208 | 209 | private void onTapChangedAirGestureState(String args) 210 | { 211 | if (OnTapChangedAirGestureState != null) 212 | { 213 | string[] argParts = args.Split(ARGS_SEPERATOR); 214 | if (argParts.Length >= 2) 215 | { 216 | int state = 0; 217 | 218 | if (Int32.TryParse(argParts[1], out state)) 219 | { 220 | OnTapChangedAirGestureState(argParts[0], state == 1); 221 | } 222 | } 223 | 224 | } 225 | } 226 | 227 | public void StartControllerWithMouseHIDMode(string tapIdentifier) 228 | { 229 | tapUnityAdapter.Call("startControllerWithMouseHIDMode", tapIdentifier); 230 | } 231 | 232 | public void StartRawSensorMode(string tapIdentifier, int deviceAccelerometerSensitivity, int imuGyroSensitivity, int imuAccelerometerSensitivity) 233 | { 234 | tapUnityAdapter.Call("startRawSensorMode", tapIdentifier, deviceAccelerometerSensitivity, imuGyroSensitivity, imuAccelerometerSensitivity); 235 | } 236 | 237 | public void Vibrate(string tapIdentifier, int[] durations) 238 | { 239 | string durationsString = ""; 240 | string delimeter = "^"; 241 | for (int i = 0; i < durations.Length; i++) 242 | { 243 | durationsString = durationsString + durations[i].ToString(); 244 | if (i < durations.Length - 1) 245 | { 246 | durationsString = durationsString + delimeter; 247 | } 248 | } 249 | tapUnityAdapter.Call("vibrate", tapIdentifier, durationsString, delimeter); 250 | 251 | } 252 | 253 | public void SetDefaultControllerMode(bool applyToConnectedTaps) 254 | { 255 | tapUnityAdapter.Call("setDefaultControllerMode", applyToConnectedTaps); 256 | } 257 | 258 | public void SetDefaultTextMode(bool applyToConnectedTaps) 259 | { 260 | tapUnityAdapter.Call("setDefaultTextMode", applyToConnectedTaps); 261 | } 262 | 263 | public void SetDefaultControllerWithMouseHIDMode(bool applyToConnectedTaps) 264 | { 265 | tapUnityAdapter.Call("setDefaultControllerWithMouseHIDMode", applyToConnectedTaps); 266 | } 267 | 268 | public bool isAnyTapInAirGestureState() { 269 | return tapUnityAdapter.Call("isAnyTapInAirGestureState"); 270 | } 271 | 272 | public bool isAnyTapSupportsAirGestures() 273 | { 274 | return tapUnityAdapter.Call("isAnyTapSupportsAirGesture"); 275 | } 276 | 277 | public void startXRTappingState(string tapIdentifier) 278 | { 279 | tapUnityAdapter.Call("startXRTappingState", tapIdentifier); 280 | 281 | } 282 | 283 | public void startXRAirMouseState(string tapIdentifier) 284 | { 285 | tapUnityAdapter.Call("startXRAirMouseState", tapIdentifier); 286 | } 287 | 288 | public void startXRUserControlState(string tapIdentifier) 289 | { 290 | tapUnityAdapter.Call("startXRUserControlState", tapIdentifier); 291 | } 292 | 293 | public void setDefaultXRAirMouseState(bool applyToConnectedTaps) 294 | { 295 | tapUnityAdapter.Call("setDefaultXRAirMouseState", applyToConnectedTaps); 296 | } 297 | 298 | public void setDefaultXRTappingState(bool applyToConnectedTaps) 299 | { 300 | tapUnityAdapter.Call("setDefaultXRTappingState", applyToConnectedTaps); 301 | } 302 | 303 | public void setDefaultXRUserControlState(bool applyToConnectedTaps) 304 | { 305 | tapUnityAdapter.Call("setDefaultXRUserControlState", applyToConnectedTaps); 306 | } 307 | } 308 | 309 | #endif -------------------------------------------------------------------------------- /Assets/TAP/Android/TapInputAndroid.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f5db776ecfd34a189a84ba9df77eb83 3 | timeCreated: 1551707605 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/TAP/Android/tap-android-sdk-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/Android/tap-android-sdk-release.aar -------------------------------------------------------------------------------- /Assets/TAP/Android/tap-android-sdk-release.aar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba7c276ef43a8402d9866f1e502e8963 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Android: Android 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Any: 21 | second: 22 | enabled: 0 23 | settings: {} 24 | - first: 25 | Editor: Editor 26 | second: 27 | enabled: 0 28 | settings: 29 | DefaultValueInitialized: true 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Assets/TAP/Android/tap-unity-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/Android/tap-unity-release.aar -------------------------------------------------------------------------------- /Assets/TAP/Android/tap-unity-release.aar.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bf348f251c45f4ced8f4567916164f64 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Android: Android 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Any: 21 | second: 22 | enabled: 0 23 | settings: {} 24 | - first: 25 | Editor: Editor 26 | second: 27 | enabled: 0 28 | settings: 29 | DefaultValueInitialized: true 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Assets/TAP/Main.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbf42cee1cef64be4b3d38197f2fb671 3 | folderAsset: yes 4 | timeCreated: 1551707586 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/TAP/Main/ITapInput.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System; 4 | 5 | public interface ITapInput 6 | { 7 | event Action OnBluetoothTurnedOn; 8 | event Action OnBluetoothTurnedOff; 9 | event Action OnTapConnected; 10 | event Action OnTapDisconnected; 11 | event Action OnTapInputReceived; 12 | event Action OnMouseInputReceived; 13 | event Action OnConnectedTapsReceived; 14 | event Action OnAirGestureInputReceived; 15 | event Action OnTapChangedAirGestureState; 16 | event Action OnRawSensorDataReceived; 17 | 18 | 19 | void EnableDebug(); 20 | void DisableDebug(); 21 | void StartControllerMode(string tapIdentifier); 22 | void StartTextMode(string tapIdentifier); 23 | void StartControllerWithMouseHIDMode(string tapIdentifier); 24 | void StartRawSensorMode(string tapIdentifier, int deviceAccelerometerSensitivity, int imuGyroSensitivity, int imuAccelerometerSensitivity); 25 | 26 | void SetDefaultControllerMode(bool applyToConnectedTaps); 27 | void SetDefaultTextMode(bool applyToConnectedTaps); 28 | void SetDefaultControllerWithMouseHIDMode(bool applyToConnectedTaps); 29 | 30 | void startXRTappingState(string tapIdentifier); 31 | void startXRAirMouseState(string tapIdentifier); 32 | void startXRUserControlState(string tapIdentifier); 33 | 34 | void setDefaultXRAirMouseState(bool applyToConnectedTaps); 35 | void setDefaultXRTappingState(bool applyToConnectedTaps); 36 | void setDefaultXRUserControlState(bool applyToConnectedTaps); 37 | 38 | void Vibrate(string tapIdentifier, int[] durations); 39 | 40 | bool isAnyTapInAirGestureState(); 41 | bool isAnyTapSupportsAirGestures(); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Assets/TAP/Main/ITapInput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7521a6e4e84fe4b1cb4ec1525dce15d2 3 | timeCreated: 1551707633 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/TAP/Main/RawSensorData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class RawSensorData 6 | { 7 | public enum DataType 8 | { 9 | IMU, 10 | Device 11 | } 12 | 13 | public static readonly int iIMU_GYRO = 0; 14 | public static readonly int iIMU_ACCELEROMETER = 1; 15 | public static readonly int iDEV_THUMB = 0; 16 | public static readonly int iDEV_INDEX = 1; 17 | public static readonly int iDEV_MIDDLE = 2; 18 | public static readonly int iDEV_RING = 3; 19 | public static readonly int iDEV_PINKY = 4; 20 | 21 | public readonly int timestamp; 22 | public readonly DataType type; 23 | public readonly Vector3[] points; 24 | 25 | public readonly string streamedString; 26 | 27 | private RawSensorData(int timestamp, DataType type, Vector3[] points, string streamedString) { 28 | this.timestamp = timestamp; 29 | this.type = type; 30 | this.points = points; 31 | this.streamedString = streamedString; 32 | } 33 | 34 | public static RawSensorData makeFromString(string str, string delimeter) 35 | { 36 | string[] components = str.Split(delimeter[0]); 37 | 38 | if (components.Length < 2) 39 | { 40 | return null; 41 | } 42 | 43 | string timestampString = components[0]; 44 | 45 | int timestamp; 46 | if (!int.TryParse(timestampString, out timestamp)) 47 | { 48 | return null; 49 | } 50 | 51 | string typeString = components[1]; 52 | DataType type; 53 | if (typeString.ToLower().Equals("imu")) 54 | { 55 | type = DataType.IMU; 56 | } else if (typeString.ToLower().Equals("device")) 57 | { 58 | type = DataType.Device; 59 | } else 60 | { 61 | return null; 62 | } 63 | 64 | int pointsLength = 0; 65 | if (type == DataType.Device) 66 | { 67 | if (components.Length < 17) 68 | { 69 | return null; 70 | } else 71 | { 72 | pointsLength = 5; 73 | } 74 | } 75 | else 76 | { 77 | if (components.Length < 8) 78 | { 79 | return null; 80 | } else 81 | { 82 | pointsLength = 2; 83 | } 84 | } 85 | 86 | if (pointsLength == 0) 87 | { 88 | return null; 89 | } 90 | 91 | Vector3[] points = new Vector3[pointsLength]; 92 | int i = 2; 93 | int pointIndex = 0; 94 | while (i < components.Length) 95 | { 96 | double x = 0.0; 97 | double y = 0.0; 98 | double z = 0.0; 99 | 100 | if (!double.TryParse(components[i], out x)) 101 | { 102 | 103 | return null; 104 | } 105 | i++; 106 | if (i >= components.Length) 107 | { 108 | 109 | return null; 110 | } 111 | if (!double.TryParse(components[i], out y)) 112 | { 113 | return null; 114 | } 115 | i++; 116 | if (i >= components.Length) 117 | { 118 | return null; 119 | } 120 | if (!double.TryParse(components[i], out z)) 121 | { 122 | return null; 123 | } 124 | i++; 125 | Vector3 point = new Vector3((float)x, (float)y, (float)z); 126 | if (pointIndex < points.Length) 127 | { 128 | points[pointIndex] = point; 129 | } else 130 | { 131 | return null; 132 | } 133 | pointIndex++; 134 | } 135 | 136 | return new RawSensorData(timestamp, type, points, str); 137 | 138 | } 139 | 140 | public Vector3 GetPoint(int index) 141 | { 142 | if (this.points.Length > 0 && index >= 0 && index < this.points.Length) 143 | { 144 | return this.points[index]; 145 | } else 146 | { 147 | return new Vector3(0,0,0); 148 | } 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /Assets/TAP/Main/RawSensorData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5c5769c4c8f748c1bf1c1f554e77139 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/TAP/Main/Singleton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | /// 4 | /// Inherit from this base class to create a singleton. 5 | /// e.g. public class MyClassName : Singleton {} 6 | /// 7 | public abstract class Singleton : MonoBehaviour where T : MonoBehaviour 8 | { 9 | // Check to see if we're about to be destroyed. 10 | private static bool m_ShuttingDown = false; 11 | private static object m_Lock = new object(); 12 | private static T m_Instance; 13 | 14 | /// 15 | /// Access singleton instance through this propriety. 16 | /// 17 | public static T Instance 18 | { 19 | get 20 | { 21 | if (m_ShuttingDown) 22 | { 23 | Debug.LogWarning("[Singleton] Instance '" + typeof(T) + 24 | "' already destroyed. Returning null."); 25 | return null; 26 | } 27 | 28 | lock (m_Lock) 29 | { 30 | if (m_Instance == null) 31 | { 32 | // Search for existing instance. 33 | m_Instance = (T)FindObjectOfType(typeof(T)); 34 | 35 | // Create new instance if one doesn't already exist. 36 | if (m_Instance == null) 37 | { 38 | // Need to create a new GameObject to attach the singleton to. 39 | var singletonObject = new GameObject(); 40 | m_Instance = singletonObject.AddComponent(); 41 | singletonObject.name = typeof(T).ToString(); 42 | 43 | // Make instance persistent. 44 | DontDestroyOnLoad(singletonObject); 45 | 46 | ((Singleton) (object) m_Instance).OnInit(); 47 | } 48 | } 49 | 50 | return m_Instance; 51 | } 52 | } 53 | } 54 | 55 | public abstract void OnInit(); 56 | 57 | private void OnApplicationQuit() 58 | { 59 | m_ShuttingDown = true; 60 | } 61 | 62 | private void OnDestroy() 63 | { 64 | m_ShuttingDown = true; 65 | } 66 | } -------------------------------------------------------------------------------- /Assets/TAP/Main/Singleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d913ba9cbf5cc4cca9837ca326e1cf11 3 | timeCreated: 1551707633 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/TAP/Main/TapAirGesture.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public enum TapAirGesture 6 | { 7 | OneFingerUp = 2, 8 | TwoFingersUp = 3, 9 | OneFingerDown = 4, 10 | TwoFingersDown = 5, 11 | OneFingerLeft = 6, 12 | TwoFingersLeft = 7, 13 | OnefingerRight = 8, 14 | TwoFingersRight = 9, 15 | IndexToThumbTouch = 10, 16 | MiddleToThumbTouch = 11, 17 | 18 | xrAirGestureNone = 100, 19 | xrAirGestureThumbIndex = 101, 20 | xrAirGestureThumbMiddle = 102 21 | } 22 | -------------------------------------------------------------------------------- /Assets/TAP/Main/TapAirGesture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f1f53a5a5f194e64823386e62483791 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/TAP/Main/TapCombination.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | public class TapCombination { 6 | 7 | 8 | private TapCombination() { 9 | 10 | } 11 | 12 | public static bool[] toFingers(int combination) { 13 | bool[] arr = new bool[5]; 14 | arr [0] = (combination & 1) > 0 ? true : false; 15 | arr [1] = (combination & 2) > 0 ? true : false; 16 | arr [2] = (combination & 4) > 0 ? true : false; 17 | arr [3] = (combination & 8) > 0 ? true : false; 18 | arr [4] = (combination & 16) > 0 ? true : false; 19 | return arr; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Assets/TAP/Main/TapCombination.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe59bc475eea64ef1abd1fce452684ac 3 | timeCreated: 1551707633 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/TAP/Main/TapInputEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | public class TapInputEditor : Singleton, ITapInput 5 | { 6 | 7 | // suppress "is not used" warning 8 | #pragma warning disable 0067 9 | 10 | public event Action OnBluetoothTurnedOn; 11 | public event Action OnBluetoothTurnedOff; 12 | public event Action OnTapConnected; 13 | public event Action OnTapDisconnected; 14 | public event Action OnControllerModeStarted; 15 | public event Action OnTextModeStarted; 16 | public event Action OnTapInputReceived; 17 | public event Action OnMouseInputReceived; 18 | public event Action OnRawSensorDataReceived; 19 | public event Action OnConnectedTapsReceived; 20 | public event Action OnModeReceived; 21 | public event Action OnAirGestureInputReceived; 22 | public event Action OnTapChangedAirGestureState; 23 | 24 | #pragma warning restore 0067 25 | 26 | public override void OnInit() 27 | { 28 | Debug.Log("TapInputEditor - OnInit"); 29 | } 30 | 31 | public void EnableDebug() 32 | { 33 | Debug.Log("TapInputEditor - EnableDebug"); 34 | } 35 | 36 | public void DisableDebug() 37 | { 38 | Debug.Log("TapInputEditor - DisableDebug"); 39 | } 40 | 41 | public void StartControllerMode(string tapIdentifier) 42 | { 43 | 44 | } 45 | 46 | public void StartTextMode(string tapIdentifier) 47 | { 48 | 49 | } 50 | 51 | public void StartControllerWithMouseHIDMode(string tapIdentifier) 52 | { 53 | 54 | } 55 | 56 | public void StartRawSensorMode(string tapIdentifier, int deviceAccelerometerSensitivity, int imuGyroSensitivity, int imuAccelerometerSensitivity) 57 | { 58 | 59 | } 60 | 61 | public void Vibrate(string tapIdentifier, int[] durations) 62 | { 63 | 64 | } 65 | 66 | public void SetDefaultControllerMode(bool applyToConnectedTaps) 67 | { 68 | 69 | } 70 | 71 | public void SetDefaultTextMode(bool applyToConnectedTaps) 72 | { 73 | 74 | } 75 | 76 | public void SetDefaultControllerWithMouseHIDMode(bool applyToConnectedTaps) 77 | { 78 | 79 | } 80 | 81 | public bool isAnyTapInAirGestureState() 82 | { 83 | return false; 84 | } 85 | 86 | public bool isAnyTapSupportsAirGestures() 87 | { 88 | return false; 89 | } 90 | 91 | public void startXRTappingState(string tapIdentifier) 92 | { 93 | 94 | } 95 | 96 | public void startXRAirMouseState(string tapIdentifier) 97 | { 98 | 99 | } 100 | 101 | public void startXRUserControlState(string tapIdentifier) 102 | { 103 | 104 | } 105 | 106 | public void setDefaultXRAirMouseState(bool applyToConnectedTaps) 107 | { 108 | 109 | } 110 | 111 | public void setDefaultXRTappingState(bool applyToConnectedTaps) 112 | { 113 | 114 | } 115 | 116 | public void setDefaultXRUserControlState(bool applyToConnectedTaps) 117 | { 118 | 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Assets/TAP/Main/TapInputEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 08bc50c6a8b1647859332b5f30c7cfa9 3 | timeCreated: 1551707633 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/TAP/Main/TapInputManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | using System.Runtime.InteropServices; 6 | using AOT; 7 | 8 | public class TapInputManager : Singleton, ITapInput { 9 | 10 | private ITapInput tapInput; 11 | 12 | // suppress "is not used" warning 13 | #pragma warning disable 0067 14 | 15 | public event Action OnBluetoothTurnedOn; 16 | public event Action OnBluetoothTurnedOff; 17 | public event Action OnTapConnected; 18 | public event Action OnTapDisconnected; 19 | public event Action OnControllerModeStarted; 20 | public event Action OnTextModeStarted; 21 | public event Action OnTapInputReceived; 22 | public event Action OnMouseInputReceived; 23 | public event Action OnConnectedTapsReceived; 24 | public event Action OnModeReceived; 25 | public event Action OnAirGestureInputReceived; 26 | public event Action OnTapChangedAirGestureState; 27 | public event Action OnRawSensorDataReceived; 28 | #pragma warning restore 0067 29 | 30 | public override void OnInit() 31 | { 32 | 33 | #if UNITY_EDITOR 34 | tapInput = TapInputEditor.Instance; 35 | 36 | #elif UNITY_ANDROID 37 | tapInput = TapInputAndroid.Instance; 38 | 39 | #elif UNITY_IOS 40 | tapInput = TapInputIOS.Instance; 41 | 42 | //#elif UNITY_STANDALONE_WIN 43 | // tapInput = TapInputStandaloneWin.Instance; 44 | 45 | #endif 46 | 47 | tapInput.OnTapConnected += onTapConnected; 48 | tapInput.OnTapDisconnected += onTapDisconnected; 49 | tapInput.OnTapInputReceived += onTapped; 50 | tapInput.OnBluetoothTurnedOn += onBluetoothTurnedOn; 51 | tapInput.OnBluetoothTurnedOff += onBluetoothTurnedOff; 52 | tapInput.OnMouseInputReceived += onMoused; 53 | tapInput.OnAirGestureInputReceived += onAirGestureInputReceived; 54 | tapInput.OnTapChangedAirGestureState += onTapChangedAirGestureState; 55 | tapInput.OnRawSensorDataReceived += onRawSensorDataReceived; 56 | } 57 | 58 | 59 | 60 | private void onTapConnected(string identifier, string name, int fw) 61 | { 62 | if (OnTapConnected != null) { 63 | OnTapConnected(identifier, name, fw); 64 | } 65 | } 66 | 67 | private void onTapDisconnected(string identifier) 68 | { 69 | if (OnTapDisconnected != null) { 70 | OnTapDisconnected(identifier); 71 | } 72 | } 73 | 74 | private void onTapped(string identifier, int combination) 75 | { 76 | if (OnTapInputReceived != null) { 77 | OnTapInputReceived(identifier, combination); 78 | } 79 | } 80 | 81 | private void onMoused(string identifier, int vx, int vy, bool isMouse) 82 | { 83 | if (OnMouseInputReceived != null) { 84 | OnMouseInputReceived(identifier, vx, vy, isMouse); 85 | } 86 | } 87 | 88 | private void onBluetoothTurnedOn() 89 | { 90 | if (OnBluetoothTurnedOn != null) { 91 | OnBluetoothTurnedOn(); 92 | } 93 | } 94 | 95 | private void onBluetoothTurnedOff() 96 | { 97 | if (OnBluetoothTurnedOff != null) { 98 | OnBluetoothTurnedOff(); 99 | } 100 | } 101 | 102 | private void onAirGestureInputReceived(string tapIdentifier, TapAirGesture gesture) 103 | { 104 | if (OnAirGestureInputReceived != null) 105 | { 106 | OnAirGestureInputReceived(tapIdentifier, gesture); 107 | } 108 | } 109 | 110 | private void onRawSensorDataReceived(string tapIdentifier, RawSensorData rawSensorData) 111 | { 112 | if (OnRawSensorDataReceived != null) 113 | { 114 | OnRawSensorDataReceived(tapIdentifier, rawSensorData); 115 | } 116 | } 117 | 118 | private void onTapChangedAirGestureState(string tapIdentifier, bool isAirGesture) 119 | { 120 | if (OnTapChangedAirGestureState != null) 121 | { 122 | OnTapChangedAirGestureState(tapIdentifier, isAirGesture); 123 | } 124 | } 125 | 126 | public void EnableDebug() 127 | { 128 | tapInput.EnableDebug(); 129 | } 130 | 131 | public void DisableDebug() 132 | { 133 | tapInput.DisableDebug(); 134 | } 135 | 136 | public void StartControllerMode(string tapIdentifier) 137 | { 138 | tapInput.StartControllerMode(tapIdentifier); 139 | 140 | } 141 | 142 | public void StartTextMode(string tapIdentifier) 143 | { 144 | tapInput.StartTextMode(tapIdentifier); 145 | 146 | } 147 | 148 | public void StartControllerWithMouseHIDMode(string tapIdentifier) 149 | { 150 | tapInput.StartControllerWithMouseHIDMode(tapIdentifier); 151 | 152 | } 153 | 154 | public void StartRawSensorMode(string tapIdentifier, int deviceAccelerometerSensitivity, int imuGyroSensitivity, int imuAccelerometerSensitivity) 155 | { 156 | tapInput.StartRawSensorMode(tapIdentifier, deviceAccelerometerSensitivity, imuGyroSensitivity, imuAccelerometerSensitivity); 157 | } 158 | 159 | public void SetDefaultControllerMode(bool applyToConnectedTaps) 160 | { 161 | tapInput.SetDefaultControllerMode(applyToConnectedTaps); 162 | } 163 | 164 | public void SetDefaultTextMode(bool applyToConnectedTaps) 165 | { 166 | tapInput.SetDefaultTextMode(applyToConnectedTaps); 167 | } 168 | 169 | public void SetDefaultControllerWithMouseHIDMode(bool applyToConnectedTaps) 170 | { 171 | tapInput.SetDefaultControllerWithMouseHIDMode(applyToConnectedTaps); 172 | } 173 | 174 | public void Vibrate(string tapIdentifier, int[] durations) 175 | { 176 | tapInput.Vibrate(tapIdentifier, durations); 177 | } 178 | 179 | public bool isAnyTapInAirGestureState() 180 | { 181 | return tapInput.isAnyTapInAirGestureState(); 182 | } 183 | 184 | public bool isAnyTapSupportsAirGestures() 185 | { 186 | return tapInput.isAnyTapSupportsAirGestures(); 187 | } 188 | 189 | public void startXRTappingState(string tapIdentifier) 190 | { 191 | tapInput.startXRTappingState(tapIdentifier); 192 | 193 | } 194 | 195 | public void startXRAirMouseState(string tapIdentifier) 196 | { 197 | tapInput.startXRAirMouseState(tapIdentifier); 198 | } 199 | 200 | public void startXRUserControlState(string tapIdentifier) 201 | { 202 | tapInput.startXRUserControlState(tapIdentifier); 203 | 204 | } 205 | 206 | public void setDefaultXRAirMouseState(bool applyToConnectedTaps) 207 | { 208 | tapInput.setDefaultXRAirMouseState(applyToConnectedTaps); 209 | 210 | } 211 | 212 | public void setDefaultXRTappingState(bool applyToConnectedTaps) 213 | { 214 | tapInput.setDefaultXRTappingState(applyToConnectedTaps); 215 | 216 | } 217 | 218 | public void setDefaultXRUserControlState(bool applyToConnectedTaps) 219 | { 220 | tapInput.setDefaultXRUserControlState(applyToConnectedTaps); 221 | 222 | } 223 | 224 | //private void PerformTapAction(string tapIdentifier, Action action) 225 | //{ 226 | // if (tapIdentifier.Equals(TapInputManager._ALL_TAPS_)) 227 | // { 228 | // foreach (string identifier in this.taps) 229 | // { 230 | // action(identifier); 231 | // } 232 | // } else 233 | // { 234 | // action(tapIdentifier); 235 | // } 236 | //} 237 | } -------------------------------------------------------------------------------- /Assets/TAP/Main/TapInputManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 048be25401b3a4b04b35348779a41063 3 | timeCreated: 1551707633 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/TAP/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4fbfa62ce8b04ef0adf1a97b2a8df4c 3 | folderAsset: yes 4 | timeCreated: 1551707591 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/TAP/Test/DragThisToYourSceneToTest.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1532718638114766} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1532718638114766 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4380301765117352} 22 | - component: {fileID: 114087754655917132} 23 | m_Layer: 0 24 | m_Name: DragThisToYourSceneToTest 25 | m_TagString: Untagged 26 | m_Icon: {fileID: 0} 27 | m_NavMeshLayer: 0 28 | m_StaticEditorFlags: 0 29 | m_IsActive: 1 30 | --- !u!4 &4380301765117352 31 | Transform: 32 | m_ObjectHideFlags: 1 33 | m_PrefabParentObject: {fileID: 0} 34 | m_PrefabInternal: {fileID: 100100000} 35 | m_GameObject: {fileID: 1532718638114766} 36 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 37 | m_LocalPosition: {x: 0, y: 0, z: 0} 38 | m_LocalScale: {x: 1, y: 1, z: 1} 39 | m_Children: [] 40 | m_Father: {fileID: 0} 41 | m_RootOrder: 0 42 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 43 | --- !u!114 &114087754655917132 44 | MonoBehaviour: 45 | m_ObjectHideFlags: 1 46 | m_PrefabParentObject: {fileID: 0} 47 | m_PrefabInternal: {fileID: 100100000} 48 | m_GameObject: {fileID: 1532718638114766} 49 | m_Enabled: 1 50 | m_EditorHideFlags: 0 51 | m_Script: {fileID: 11500000, guid: 328333e63ff24472ea18bf063b06c4c1, type: 3} 52 | m_Name: 53 | m_EditorClassIdentifier: 54 | LogText: {fileID: 0} 55 | -------------------------------------------------------------------------------- /Assets/TAP/Test/DragThisToYourSceneToTest.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae7cad239a3d9405a8bb18c6a306d7da 3 | timeCreated: 1551707640 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/TAP/Test/TapInputTest.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | public class TapInputTest : MonoBehaviour 7 | { 8 | 9 | public Text LogText; 10 | 11 | private ITapInput tapInputManager; 12 | 13 | private bool mouseHIDEnabled; 14 | 15 | private string connectedTapIdentifier = ""; 16 | 17 | void Start() 18 | { 19 | tapInputManager = TapInputManager.Instance; 20 | tapInputManager.OnTapInputReceived += onTapped; 21 | tapInputManager.OnTapConnected += onTapConnected; 22 | tapInputManager.OnTapDisconnected += onTapDisconnected; 23 | tapInputManager.OnMouseInputReceived += onMoused; 24 | tapInputManager.OnAirGestureInputReceived += onAirGestureInputReceived; 25 | tapInputManager.OnTapChangedAirGestureState += onTapChangedState; 26 | tapInputManager.OnRawSensorDataReceived += onRawSensorDataReceived; 27 | tapInputManager.EnableDebug(); 28 | tapInputManager.SetDefaultControllerMode(true); 29 | mouseHIDEnabled = false; 30 | } 31 | 32 | private void Log(string text) 33 | { 34 | if (LogText != null) 35 | { 36 | LogText.text += string.Format("{0}\n", text); 37 | } 38 | Debug.Log(text); 39 | } 40 | 41 | void onMoused(string identifier, int vx, int vy, bool isMouse) 42 | { 43 | // Log("onMoused" + identifier + ", velocity = (" + vx + "," + vy + "), isMouse " + isMouse); 44 | } 45 | 46 | void onTapped(string identifier, int combination) 47 | { 48 | bool[] arr = TapCombination.toFingers(combination); 49 | Log("onTapped : " + identifier + ", " + combination); 50 | } 51 | 52 | void onTapConnected(string identifier, string name, int fw) 53 | { 54 | Debug.Log("onTapConnected : " + identifier + ", " + name + ", FW: " + fw); 55 | Log("onTapConnected : " + identifier + ", " + name); 56 | this.connectedTapIdentifier = identifier; 57 | } 58 | 59 | void onTapDisconnected(string identifier) 60 | { 61 | Debug.Log("UNITY TAP CALLBACK --- onTapDisconnected : " + identifier); 62 | Log("UNITY TAP CALLBACK --- onTapDisconnected : " + identifier); 63 | if (identifier.Equals(this.connectedTapIdentifier)) 64 | { 65 | this.connectedTapIdentifier = ""; 66 | } 67 | } 68 | 69 | 70 | void onAirGestureInputReceived(string tapIdentifier, TapAirGesture gesture) 71 | { 72 | 73 | Log("OnAirGestureInputReceived: " + tapIdentifier + ", " + gesture.ToString()); 74 | } 75 | 76 | void onTapChangedState(string tapIdentifier, bool isAirGesture) 77 | { 78 | Log("onTapChangedState: " + tapIdentifier + ", " + isAirGesture.ToString()); 79 | 80 | } 81 | 82 | void onRawSensorDataReceived(string tapIdentifier, RawSensorData data) 83 | { 84 | //RawSensorData Object has a timestamp, type and an array points(x,y,z). 85 | if (data.type == RawSensorData.DataType.Device) 86 | { 87 | // Fingers accelerometer. 88 | // Each point in array represents the accelerometer value of a finger (thumb, index, middle, ring, pinky). 89 | Vector3 thumb = data.GetPoint(RawSensorData.iDEV_THUMB); 90 | 91 | if (thumb != null) 92 | { 93 | // Do something with thumb.x, thumb.y, thumb.z 94 | } 95 | // Etc... use indexes: RawSensorData.iDEV_THUMB, RawSensorData.iDEV_INDEX, RawSensorData.iDEV_MIDDLE, RawSensorData.iDEV_RING, RawSensorData.iDEV_PINKY 96 | } 97 | else if (data.type == RawSensorData.DataType.IMU) 98 | { 99 | // Refers to an additional accelerometer on the Thumb sensor and a Gyro (placed on the thumb unit as well). 100 | Vector3 gyro = data.GetPoint(RawSensorData.iIMU_GYRO); 101 | if (gyro != null) 102 | { 103 | // Do something with gyro.x, gyro.y, gyro.z 104 | } 105 | // Etc... use indexes: RawSensorData.iIMU_GYRO, RawSensorData.iIMU_ACCELEROMETER 106 | } 107 | // ------------------------------------------------- 108 | // -- Please refer readme.md for more information -- 109 | // ------------------------------------------------- 110 | } 111 | } -------------------------------------------------------------------------------- /Assets/TAP/Test/TapInputTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 328333e63ff24472ea18bf063b06c4c1 3 | timeCreated: 1551707640 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/TAP/WindowsStandalone.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3d5392cef062478e96a5c84353117ba 3 | folderAsset: yes 4 | timeCreated: 1551707573 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/TAP/WindowsStandalone/TAPInputStandaloneWin.cs: -------------------------------------------------------------------------------- 1 | #if false //UNITY_STANDALONE_WIN && !UNITY_EDITOR 2 | 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | using System; 7 | using System.Runtime.InteropServices; 8 | 9 | public class TapInputStandaloneWin : Singleton, ITapInput 10 | { 11 | 12 | 13 | [DllImport("TAPWin")] 14 | extern static void TAPWinUnityBridgeStart(); 15 | 16 | [DllImport("TAPWin")] 17 | extern static bool TAPWinUnityBridgeGetTapConnected(out string identifier, out string name, out int fw); 18 | 19 | [DllImport("TAPWin")] 20 | extern static bool TAPWinUnityBridgeGetTapDisconnected(out string identifier); 21 | 22 | [DllImport("TAPWin")] 23 | extern static bool TAPWinUnityBridgeGetTapped(out string identifier, out int tapcode); 24 | 25 | [DllImport("TAPWin")] 26 | extern static bool TAPWinUnityBridgeGetMoused(out string identifier, out int vx, out int vy, out bool isMouse); 27 | 28 | [DllImport("TAPWin")] 29 | extern static void TAPWinUnityBridgeSetActivated(bool enabled); 30 | 31 | 32 | public event Action OnBluetoothTurnedOn; 33 | public event Action OnBluetoothTurnedOff; 34 | public event Action OnTapConnected; 35 | public event Action OnTapDisconnected; 36 | public event Action OnTapInputReceived; 37 | public event Action OnMouseInputReceived; 38 | public event Action OnConnectedTapsReceived; 39 | public event Action OnModeReceived; 40 | public event Action OnAirGestureInputReceived; 41 | public event Action OnTapChangedAirGestureState; 42 | 43 | public void DisableDebug() 44 | { 45 | 46 | } 47 | 48 | public void EnableDebug() 49 | { 50 | 51 | } 52 | 53 | public void StartControllerMode(string tapIdentifier) 54 | { 55 | 56 | } 57 | 58 | public void StartTextMode(string tapIdentifier) 59 | { 60 | 61 | } 62 | 63 | void FixedUpdate() 64 | { 65 | 66 | sendTapConnected(5); 67 | sendTapDisconnected(5); 68 | sendTapped(20); 69 | sendMoused(20); 70 | 71 | } 72 | 73 | 74 | private void sendTapConnected(int limit) 75 | { 76 | if (OnTapConnected != null) 77 | { 78 | string identifier; 79 | string name; 80 | int fw; 81 | if (TAPWinUnityBridgeGetTapConnected(out identifier, out name, out fw) && limit > 0) 82 | { 83 | OnTapConnected(identifier, name, fw); 84 | limit--; 85 | } 86 | } 87 | 88 | 89 | } 90 | 91 | private void sendTapDisconnected(int limit) 92 | { 93 | if (OnTapDisconnected != null) 94 | { 95 | string identifier; 96 | if (TAPWinUnityBridgeGetTapDisconnected(out identifier) && limit > 0) 97 | { 98 | OnTapDisconnected(identifier); 99 | limit--; 100 | } 101 | } 102 | 103 | } 104 | 105 | private void sendTapped(int limit) 106 | { 107 | if (OnTapInputReceived != null) 108 | { 109 | string identifier; 110 | int tapcode; 111 | if (TAPWinUnityBridgeGetTapped(out identifier, out tapcode) && limit > 0) 112 | { 113 | OnTapInputReceived(identifier, tapcode); 114 | limit--; 115 | } 116 | } 117 | 118 | 119 | } 120 | 121 | private void sendMoused(int limit) 122 | { 123 | if (OnMouseInputReceived != null) 124 | { 125 | string identifier; 126 | int vx; 127 | int vy; 128 | bool isMouse; 129 | if (TAPWinUnityBridgeGetMoused(out identifier, out vx, out vy, out isMouse) && limit > 0) 130 | { 131 | OnMouseInputReceived(identifier, vx, vy, isMouse); 132 | limit--; 133 | } 134 | } 135 | 136 | 137 | } 138 | 139 | void OnApplicationQuit() 140 | { 141 | TAPWinUnityBridgeSetActivated(false); 142 | } 143 | 144 | void OnApplicationFocus(bool hasFocus) 145 | { 146 | TAPWinUnityBridgeSetActivated(hasFocus); 147 | 148 | } 149 | 150 | public override void OnInit() 151 | { 152 | TAPWinUnityBridgeStart(); 153 | } 154 | 155 | void SetMouseHIDEnabledInRawModeForAllTaps(bool enable) 156 | { 157 | 158 | } 159 | 160 | bool IsAnyTapInAirMouseState() 161 | { 162 | return false; 163 | } 164 | 165 | void readAllTapsState() 166 | { 167 | 168 | } 169 | 170 | public bool IsAnyTapSupportsAirMouse() 171 | { 172 | return false; 173 | } 174 | } 175 | 176 | #endif 177 | -------------------------------------------------------------------------------- /Assets/TAP/WindowsStandalone/TAPInputStandaloneWin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95af11a4873f94353826a70b7b66408d 3 | timeCreated: 1551707668 4 | licenseType: Pro 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/TAP/WindowsStandalone/TAPWin.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/WindowsStandalone/TAPWin.dll -------------------------------------------------------------------------------- /Assets/TAP/WindowsStandalone/TAPWin.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dec6fd9d5bdb54f8eb512471f26d502b 3 | timeCreated: 1551707668 4 | licenseType: Pro 5 | PluginImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | iconMap: {} 9 | executionOrder: {} 10 | isPreloaded: 0 11 | isOverridable: 0 12 | platformData: 13 | - first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 1 20 | Exclude Linux: 0 21 | Exclude Linux64: 0 22 | Exclude LinuxUniversal: 0 23 | Exclude OSXUniversal: 0 24 | Exclude Win: 0 25 | Exclude Win64: 0 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Facebook: Win 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | - first: 53 | Facebook: Win64 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: AnyCPU 58 | - first: 59 | Standalone: Linux 60 | second: 61 | enabled: 1 62 | settings: 63 | CPU: x86 64 | - first: 65 | Standalone: Linux64 66 | second: 67 | enabled: 1 68 | settings: 69 | CPU: x86_64 70 | - first: 71 | Standalone: LinuxUniversal 72 | second: 73 | enabled: 1 74 | settings: {} 75 | - first: 76 | Standalone: OSXUniversal 77 | second: 78 | enabled: 1 79 | settings: 80 | CPU: AnyCPU 81 | - first: 82 | Standalone: Win 83 | second: 84 | enabled: 1 85 | settings: 86 | CPU: AnyCPU 87 | - first: 88 | Standalone: Win64 89 | second: 90 | enabled: 1 91 | settings: 92 | CPU: AnyCPU 93 | - first: 94 | iPhone: iOS 95 | second: 96 | enabled: 0 97 | settings: 98 | CompileFlags: 99 | FrameworkDependencies: 100 | userData: 101 | assetBundleName: 102 | assetBundleVariant: 103 | -------------------------------------------------------------------------------- /Assets/TAP/iOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb01bbe3a67d24192a5cbbcdbd3204c6 3 | folderAsset: yes 4 | timeCreated: 1551707564 5 | licenseType: Pro 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4e64bb21ab714665a927d494e0d1cbc 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude Win: 1 24 | Exclude Win64: 1 25 | Exclude iOS: 0 26 | - first: 27 | Android: Android 28 | second: 29 | enabled: 0 30 | settings: 31 | AndroidSharedLibraryType: Executable 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 1 74 | settings: 75 | AddToEmbeddedBinaries: true 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/iOS/TAPKitUnityBridge.framework/.DS_Store -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/Frameworks/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/iOS/TAPKitUnityBridge.framework/Frameworks/.DS_Store -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/Frameworks/TAPKit.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/iOS/TAPKitUnityBridge.framework/Frameworks/TAPKit.framework/Info.plist -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/Frameworks/TAPKit.framework/TAPKit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/iOS/TAPKitUnityBridge.framework/Frameworks/TAPKit.framework/TAPKit -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/Frameworks/TAPKit.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Info.plist 8 | 9 | f5DqABHHAxdz6Tk8jG18x+q7vXg= 10 | 11 | 12 | files2 13 | 14 | rules 15 | 16 | ^.* 17 | 18 | ^.*\.lproj/ 19 | 20 | optional 21 | 22 | weight 23 | 1000 24 | 25 | ^.*\.lproj/locversion.plist$ 26 | 27 | omit 28 | 29 | weight 30 | 1100 31 | 32 | ^Base\.lproj/ 33 | 34 | weight 35 | 1010 36 | 37 | ^version.plist$ 38 | 39 | 40 | rules2 41 | 42 | .*\.dSYM($|/) 43 | 44 | weight 45 | 11 46 | 47 | ^(.*/)?\.DS_Store$ 48 | 49 | omit 50 | 51 | weight 52 | 2000 53 | 54 | ^.* 55 | 56 | ^.*\.lproj/ 57 | 58 | optional 59 | 60 | weight 61 | 1000 62 | 63 | ^.*\.lproj/locversion.plist$ 64 | 65 | omit 66 | 67 | weight 68 | 1100 69 | 70 | ^Base\.lproj/ 71 | 72 | weight 73 | 1010 74 | 75 | ^Info\.plist$ 76 | 77 | omit 78 | 79 | weight 80 | 20 81 | 82 | ^PkgInfo$ 83 | 84 | omit 85 | 86 | weight 87 | 20 88 | 89 | ^embedded\.provisionprofile$ 90 | 91 | weight 92 | 20 93 | 94 | ^version\.plist$ 95 | 96 | weight 97 | 20 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/Headers/TAPKitUnityBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // TAPKitUnityBridge.h 3 | // TAPKitUnityBridge 4 | // 5 | // Created by Shahar Biran on 19/02/2020. 6 | // Copyright © 2020 Shahar Biran. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for TAPKitUnityBridge. 12 | FOUNDATION_EXPORT double TAPKitUnityBridgeVersionNumber; 13 | 14 | //! Project version string for TAPKitUnityBridge. 15 | FOUNDATION_EXPORT const unsigned char TAPKitUnityBridgeVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/iOS/TAPKitUnityBridge.framework/Info.plist -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module TAPKitUnityBridge { 2 | umbrella header "TAPKitUnityBridge.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/TAPKitUnityBridge: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TapWithUs/tap-unity-plugin/5dc5923dff92d5d7f5f924d55abeac04cb9ed78f/Assets/TAP/iOS/TAPKitUnityBridge.framework/TAPKitUnityBridge -------------------------------------------------------------------------------- /Assets/TAP/iOS/TAPKitUnityBridge.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | .DS_Store 8 | 9 | wc6WCkG9HKVaAyCbwbCyGE/OkuA= 10 | 11 | Frameworks/.DS_Store 12 | 13 | OAB0kVApgN8goDLJNcsm7qrqUs8= 14 | 15 | Frameworks/TAPKit.framework/Info.plist 16 | 17 | f5DqABHHAxdz6Tk8jG18x+q7vXg= 18 | 19 | Frameworks/TAPKit.framework/TAPKit 20 | 21 | L1xikRdZUtws6VQb1oP4LkgxgS8= 22 | 23 | Frameworks/TAPKit.framework/_CodeSignature/CodeResources 24 | 25 | Pu/PQcvB2sFO5Ue3DurKFlOCY4g= 26 | 27 | Headers/TAPKitUnityBridge.h 28 | 29 | q6aWnM1ivPVErYJTkj/YzzNCYvw= 30 | 31 | Info.plist 32 | 33 | lCdAGNeePiUgSHMLch0YSGTlTRc= 34 | 35 | Modules/module.modulemap 36 | 37 | VipkdXAGAdt2gbjXHctlzxQ5nSI= 38 | 39 | 40 | files2 41 | 42 | Frameworks/TAPKit.framework/Info.plist 43 | 44 | hash2 45 | 46 | Iasj92mNMsz9WkBQrerWuNY6JkFojpKfpEL9YZrAEcQ= 47 | 48 | 49 | Frameworks/TAPKit.framework/TAPKit 50 | 51 | hash2 52 | 53 | QMfZWxuWmtiNOzMC+lDu0NX6k9QchkzrY2O3D7h77eY= 54 | 55 | 56 | Frameworks/TAPKit.framework/_CodeSignature/CodeResources 57 | 58 | hash2 59 | 60 | l5koMANLwxv5FFMF59gvtFm9uwVjrf5HGVpBTiZsI5c= 61 | 62 | 63 | Headers/TAPKitUnityBridge.h 64 | 65 | hash2 66 | 67 | +fgVaK6AMXH+2G4MuPj5IhJhFI6N6wXCCR55daINZnE= 68 | 69 | 70 | Modules/module.modulemap 71 | 72 | hash2 73 | 74 | 2puawfwvAkpmvGr6W+XQkQrsOxgicGA7nJejEGy/MLU= 75 | 76 | 77 | 78 | rules 79 | 80 | ^.* 81 | 82 | ^.*\.lproj/ 83 | 84 | optional 85 | 86 | weight 87 | 1000 88 | 89 | ^.*\.lproj/locversion.plist$ 90 | 91 | omit 92 | 93 | weight 94 | 1100 95 | 96 | ^Base\.lproj/ 97 | 98 | weight 99 | 1010 100 | 101 | ^version.plist$ 102 | 103 | 104 | rules2 105 | 106 | .*\.dSYM($|/) 107 | 108 | weight 109 | 11 110 | 111 | ^(.*/)?\.DS_Store$ 112 | 113 | omit 114 | 115 | weight 116 | 2000 117 | 118 | ^.* 119 | 120 | ^.*\.lproj/ 121 | 122 | optional 123 | 124 | weight 125 | 1000 126 | 127 | ^.*\.lproj/locversion.plist$ 128 | 129 | omit 130 | 131 | weight 132 | 1100 133 | 134 | ^Base\.lproj/ 135 | 136 | weight 137 | 1010 138 | 139 | ^Info\.plist$ 140 | 141 | omit 142 | 143 | weight 144 | 20 145 | 146 | ^PkgInfo$ 147 | 148 | omit 149 | 150 | weight 151 | 20 152 | 153 | ^embedded\.provisionprofile$ 154 | 155 | weight 156 | 20 157 | 158 | ^version\.plist$ 159 | 160 | weight 161 | 20 162 | 163 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /Assets/TAP/iOS/TapInputIOS.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_IOS //&& !UNITY_EDITOR 2 | 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | using System.Runtime.InteropServices; 7 | using AOT; 8 | using System; 9 | public class TapInputIOS : Singleton, ITapInput { 10 | 11 | public event Action OnTapInputReceived; 12 | public event Action OnTapDisconnected; 13 | public event Action OnTapConnected; 14 | public event Action OnBluetoothTurnedOn; 15 | public event Action OnBluetoothTurnedOff; 16 | public event Action OnMouseInputReceived; 17 | public event Action OnControllerModeStarted; 18 | public event Action OnTextModeStarted; 19 | public event Action OnAirGestureInputReceived; 20 | public event Action OnTapChangedAirGestureState; 21 | public event Action OnRawSensorDataReceived; 22 | // WTF: 23 | public event Action OnConnectedTapsReceived; 24 | public event Action OnModeReceived; 25 | 26 | [DllImport("__Internal")] 27 | private static extern void TAPKit_start(); 28 | 29 | [DllImport("__Internal")] 30 | private static extern void TAPKit_setUnityCallbackForTapped(Action c); 31 | 32 | [DllImport("__Internal")] 33 | private static extern void TAPKit_setUnityCallbackForMoused(Action c); 34 | 35 | [DllImport("__Internal")] 36 | private static extern void TAPKit_setUnityCallbackForBluetoothState(Action c); 37 | 38 | [DllImport("__Internal")] 39 | private static extern void TAPKit_setUnityCallbackForTapConnected (Action c); 40 | 41 | [DllImport("__Internal")] 42 | private static extern void TAPKit_setUnityCallbackForTapDisconnected (Action c); 43 | 44 | [DllImport("__Internal")] 45 | private static extern void TAPKit_setUnityCallbackForAirGestured(Action c); 46 | 47 | [DllImport("__Internal")] 48 | private static extern void TAPKit_setUnityCallbackForChangedAirGestureState(Action c); 49 | 50 | [DllImport("__Internal")] 51 | private static extern void TAPKit_setUnityCallbackForRawSensorDataReceived(Action c); 52 | 53 | [DllImport("__Internal")] 54 | private static extern void TAPKit_setControllerMode(string identifier); 55 | 56 | [DllImport("__Internal")] 57 | private static extern void TAPKit_setTextMode(string identifier); 58 | 59 | [DllImport("__Internal")] 60 | private static extern void TAPKit_setControllerWithMouseHIDMode(string identifier); 61 | 62 | [DllImport("__Internal")] 63 | private static extern void TAPKit_setRawSensorMode(string identifier, int devAccel, int imuGyro, int imuAccel); 64 | 65 | [DllImport("__Internal")] 66 | private static extern void TAPKit_setDefaultControllerMode(bool applyImmediate); 67 | 68 | [DllImport("__Internal")] 69 | private static extern void TAPKit_setDefaultTextMode(bool applyImmediate); 70 | 71 | [DllImport("__Internal")] 72 | private static extern void TAPKit_setDefaultControllerWithMouseHIDMode(bool applyImmediate); 73 | 74 | [DllImport("__Internal")] 75 | private static extern void TAPKit_setXRTappingState(string identifier); 76 | 77 | [DllImport("__Internal")] 78 | private static extern void TAPKit_setXRAirMouseState(string identifier); 79 | 80 | [DllImport("__Internal")] 81 | private static extern void TAPKit_setXRUserControlState(string identifier); 82 | 83 | [DllImport("__Internal")] 84 | private static extern void TAPKit_setDefaultXRAirMouseState(bool applyImmediate); 85 | 86 | [DllImport("__Internal")] 87 | private static extern void TAPKit_setDefaultXRTappingState(bool applyImmediate); 88 | 89 | [DllImport("__Internal")] 90 | private static extern void TAPKit_setDefaultXRUserControlState(bool applyImmediate); 91 | 92 | [DllImport("__Internal")] 93 | private static extern void TAPKit_vibrate(string identifier, string durationsString, string delimeter); 94 | 95 | [DllImport("__Internal")] 96 | private static extern void TAPKit_enableDebug(); 97 | 98 | [DllImport("__Internal")] 99 | private static extern void TAPKit_disableDebug(); 100 | 101 | // private delegate void NoParamDelegate(); 102 | private delegate void BoolParamDelegate(bool b); 103 | private delegate void StringParamDelegate(string s); 104 | private delegate void StringAndIntParamDelegate(string s, int i); 105 | private delegate void StringAndStringParamDelegate(string s1, string s2); 106 | private delegate void StringAndTwoIntsParamDelegate(string s1, int i1, int i2); 107 | private delegate void ThreeStringsParamDelegate(string s1, string s2, string s3); 108 | private delegate void StringAndBoolParamDelegate(string s1, bool b1); 109 | private delegate void TwoStringsAndIntParamDelegate(string s1, string s2, int i1); 110 | public override void OnInit() 111 | { 112 | TAPKit_setUnityCallbackForTapped (onTapped); 113 | TAPKit_setUnityCallbackForMoused (onMoused); 114 | TAPKit_setUnityCallbackForTapConnected (onTapConnected); 115 | TAPKit_setUnityCallbackForTapDisconnected (onTapDisconnected); 116 | TAPKit_setUnityCallbackForBluetoothState (onBluetoothState); 117 | TAPKit_setUnityCallbackForAirGestured(onAirGestured); 118 | TAPKit_setUnityCallbackForChangedAirGestureState(onTapChangedAirGestureState); 119 | TAPKit_setUnityCallbackForRawSensorDataReceived(onRawSensorDataReceived); 120 | TAPKit_start (); 121 | } 122 | 123 | [MonoPInvokeCallback(typeof(BoolParamDelegate))] 124 | private static void onBluetoothState(bool poweredOn) { 125 | if (poweredOn) { 126 | if (TapInputIOS.Instance.OnBluetoothTurnedOn != null) { 127 | TapInputIOS.Instance.OnBluetoothTurnedOn (); 128 | } 129 | } else { 130 | if (TapInputIOS.Instance.OnBluetoothTurnedOff != null) { 131 | TapInputIOS.Instance.OnBluetoothTurnedOff (); 132 | } 133 | } 134 | } 135 | [MonoPInvokeCallback(typeof(StringAndIntParamDelegate))] 136 | private static void onTapped(string identifier, int combination) { 137 | if (TapInputIOS.Instance.OnTapInputReceived != null) { 138 | TapInputIOS.Instance.OnTapInputReceived (identifier, combination); 139 | } 140 | } 141 | 142 | 143 | [MonoPInvokeCallback(typeof(StringAndTwoIntsParamDelegate))] 144 | private static void onMoused(string identifier, int vx, int vy, bool isMouse) { 145 | if (TapInputIOS.Instance.OnMouseInputReceived != null) { 146 | TapInputIOS.Instance.OnMouseInputReceived(identifier, vx, vy, isMouse); 147 | } 148 | } 149 | 150 | [MonoPInvokeCallback(typeof(StringAndIntParamDelegate))] 151 | private static void onAirGestured(string identifier, int gesture) 152 | { 153 | if (TapInputIOS.Instance.OnAirGestureInputReceived != null) 154 | { 155 | if (Enum.IsDefined(typeof(TapAirGesture), gesture)) 156 | { 157 | TapInputIOS.Instance.OnAirGestureInputReceived(identifier, (TapAirGesture)gesture); 158 | } 159 | 160 | } 161 | } 162 | 163 | 164 | 165 | [MonoPInvokeCallback(typeof(ThreeStringsParamDelegate))] 166 | private static void onRawSensorDataReceived(string identifier, string data, string delimeter) 167 | { 168 | if (TapInputIOS.Instance.OnRawSensorDataReceived != null) 169 | { 170 | RawSensorData rsData = RawSensorData.makeFromString(data, delimeter); 171 | if (rsData != null) 172 | { 173 | TapInputIOS.Instance.OnRawSensorDataReceived(identifier, rsData); 174 | } 175 | } 176 | } 177 | 178 | [MonoPInvokeCallback(typeof(StringAndBoolParamDelegate))] 179 | private static void onTapChangedAirGestureState(string identifier, bool isAirGesture) 180 | { 181 | if (TapInputIOS.Instance.OnTapChangedAirGestureState != null) 182 | { 183 | TapInputIOS.Instance.OnTapChangedAirGestureState(identifier, isAirGesture); 184 | } 185 | } 186 | 187 | [MonoPInvokeCallback(typeof(TwoStringsAndIntParamDelegate))] 188 | private static void onTapConnected(string identifier, string name, int fw) { 189 | if (TapInputIOS.Instance.OnTapConnected != null) { 190 | TapInputIOS.Instance.OnTapConnected (identifier, name, fw); 191 | } 192 | } 193 | 194 | [MonoPInvokeCallback(typeof(StringParamDelegate))] 195 | private static void onTapDisconnected(string identifier) { 196 | if (TapInputIOS.Instance.OnTapDisconnected != null) { 197 | TapInputIOS.Instance.OnTapDisconnected (identifier); 198 | } 199 | } 200 | 201 | 202 | public void EnableDebug() { 203 | TAPKit_enableDebug (); 204 | } 205 | 206 | public void DisableDebug() { 207 | TAPKit_disableDebug (); 208 | } 209 | 210 | 211 | public void StartControllerMode(string identifier) { 212 | TAPKit_setControllerMode (identifier); 213 | } 214 | 215 | public void StartTextMode(string identifier) { 216 | TAPKit_setTextMode (identifier); 217 | } 218 | 219 | public void StartControllerWithMouseHIDMode(string tapIdentifier) 220 | { 221 | TAPKit_setControllerWithMouseHIDMode(tapIdentifier); 222 | } 223 | 224 | public void StartRawSensorMode(string tapIdentifier, int deviceAccelerometerSensitivity, int imuGyroSensitivity, int imuAccelerometerSensitivity) 225 | { 226 | TAPKit_setRawSensorMode(tapIdentifier, deviceAccelerometerSensitivity, imuGyroSensitivity, imuAccelerometerSensitivity); 227 | } 228 | 229 | public void Vibrate(string tapIdentifier, int[] durations) 230 | { 231 | string durationsString = ""; 232 | string delimeter = "^"; 233 | for (int i=0; i