diff --git a/.gitignore b/.gitignore index bd5740d..1a1d93c 100644 --- a/.gitignore +++ b/.gitignore @@ -79,3 +79,7 @@ crashlytics-build.properties #ide /.vs/ /.idea/ + +#wave essence +Assets/Wave/Essence +Assets/Wave/Essence.meta diff --git a/Assets/Plugins/Android/AndroidManifest.xml b/Assets/Plugins/Android/AndroidManifest.xml index abfea16..82325de 100644 --- a/Assets/Plugins/Android/AndroidManifest.xml +++ b/Assets/Plugins/Android/AndroidManifest.xml @@ -6,6 +6,7 @@ android:label="@string/app_name" android:theme="@style/Theme.WaveVR.Black" android:resizeableActivity="false" + android:requestLegacyExternalStorage="true" tools:replace="android:theme"> - + + + + + + + + + diff --git a/Assets/SampleInit.cs b/Assets/SampleInit.cs index 8b2c119..b526151 100644 --- a/Assets/SampleInit.cs +++ b/Assets/SampleInit.cs @@ -1,32 +1,50 @@ -using System.Collections; +using System; +using System.Collections; using System.Collections.Generic; +using System.IO; using UnityEngine; +using UnityEngine.Experimental.XR.Interaction; using UnityEngine.XR.Management; +using Wave.Essence; public class SampleInit : MonoBehaviour { - IEnumerator Start() + void Start() { - while (XRGeneralSettings.Instance == null ) + Debug.Log($"Start asink"); + + Debug.Log("About to write"); + + try { - Debug.Log($"Waiting on XRGeneralSettings.Instance frame {Time.frameCount}"); - yield return null; + var filePath = $"/mnt/sdcard/Android/data/{Application.identifier}/files/testingfoo"; //try creating a new file as well, for kicks + testWriteReadAtPath(filePath); } - while ( XRGeneralSettings.Instance.Manager == null) + catch (Exception e) { - Debug.Log($"Waiting on XRGeneralSettings.Instance.Manager frame {Time.frameCount}"); - yield return null; + Debug.LogException(e); } - yield return XRGeneralSettings.Instance.Manager.InitializeLoader(); - - while (!XRGeneralSettings.Instance.Manager.isInitializationComplete) + Debug.Log("About to read"); + try + { + var filePath = $"/mnt/sdcard/Android/data/{Application.identifier}/files/testfile"; + Debug.Log($"file output is {File.ReadAllText(filePath)}"); + } + catch (Exception e) { - Debug.Log($"Waiting on XRGeneralSettings.Instance.Manager.isInitializationComplete frame {Time.frameCount}"); - yield return null; + Debug.LogException(e); } - Debug.Log($"about to call XRGeneralSettings.Instance.Manager.StartSubsystems frame {Time.frameCount}"); - XRGeneralSettings.Instance.Manager.StartSubsystems(); - Debug.Log($"done calling XRGeneralSettings.Instance.Manager.StartSubsystems frame {Time.frameCount}"); + Debug.Log("end asink"); } + void testWriteReadAtPath(string filePath) + { + var msg = $"contents wooo {DateTime.Now.ToString()} and temp cache path {Application.temporaryCachePath} and persistent {Application.persistentDataPath}"; + Debug.Log($"About to write to {filePath}"); + + File.WriteAllText(filePath,msg); + Debug.Log($"Wrote message to {filePath}"); + Debug.Log($"Value of message is {File.ReadAllText(filePath)}"); + Debug.Log($"About to print external files dirs"); + } } diff --git a/Assets/Samples.meta b/Assets/Samples.meta deleted file mode 100644 index f208674..0000000 --- a/Assets/Samples.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 78b0b1cff817b4d40867ad594b375087 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Wave.meta b/Assets/Wave.meta index c5e2022..f707854 100644 --- a/Assets/Wave.meta +++ b/Assets/Wave.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: d2f580f02e6990241966118502b0034c +guid: eb6cab9ee8f801f4ca516d319ac2414d folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/XR/XRGeneralSettings.asset b/Assets/XR/XRGeneralSettings.asset index 8737014..b61d58b 100644 --- a/Assets/XR/XRGeneralSettings.asset +++ b/Assets/XR/XRGeneralSettings.asset @@ -13,7 +13,7 @@ MonoBehaviour: m_Name: Android Settings m_EditorClassIdentifier: m_LoaderManagerInstance: {fileID: 2818534104002779466} - m_InitManagerOnStart: 0 + m_InitManagerOnStart: 1 --- !u!114 &-724371777062100322 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/Packages/manifest.json b/Packages/manifest.json index 169bd90..b109b3a 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -7,6 +7,7 @@ "com.unity.ide.rider": "1.2.1", "com.unity.ide.visualstudio": "2.0.11", "com.unity.ide.vscode": "1.2.3", + "com.unity.mobile.android-logcat": "1.2.3", "com.unity.render-pipelines.universal": "7.6.0", "com.unity.test-framework": "1.1.27", "com.unity.textmeshpro": "2.1.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 4efbd3d..450ce95 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -67,6 +67,13 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.mobile.android-logcat": { + "version": "1.2.3", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.com" + }, "com.unity.render-pipelines.core": { "version": "7.6.0", "depth": 1, diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 1c9c0d8..21a7671 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -13,7 +13,7 @@ PlayerSettings: useOnDemandResources: 0 accelerometerFrequency: 60 companyName: DefaultCompany - productName: URP_Example24 + productName: AccessStorage defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} @@ -125,7 +125,9 @@ PlayerSettings: 16:9: 1 Others: 1 bundleVersion: 0.1 - preloadedAssets: [] + preloadedAssets: + - {fileID: 11400000, guid: df27b5734f961904e9d14de3d6e0e071, type: 2} + - {fileID: -2246702517388260793, guid: 574466f07abaf0c42bf023bb1b83f441, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1 @@ -168,7 +170,7 @@ PlayerSettings: androidSupportedAspectRatio: 1 androidMaxAspectRatio: 2.1 applicationIdentifier: - Android: com.DefaultCompany.URP_Example24 + Android: com.DefaultCompany.AccessStorage buildNumber: {} AndroidBundleVersionCode: 1 AndroidMinSdkVersion: 25 diff --git a/installScript.ps1 b/installScript.ps1 new file mode 100644 index 0000000..ad79b8f --- /dev/null +++ b/installScript.ps1 @@ -0,0 +1,15 @@ +Write-Host "installing apk" +adb install -r -g -d "Builds/test.apk" +Write-Host "installed apk" + +Write-Host "double checking that root directories exist" +adb shell mkdir /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files + +"fakefilecontents" | Out-file testfile + +echo "pushing sample folder of files" +adb push testfile /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files/testfile + +echo "folder of content files should now be located and accessible at /mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files" + +#/mnt/sdcard/Android/data/com.DefaultCompany.AccessStorage/files \ No newline at end of file