Skip to content

Commit

Permalink
👀
Browse files Browse the repository at this point in the history
  • Loading branch information
CADIndie committed Aug 15, 2024
1 parent df0d740 commit 1a374dd
Show file tree
Hide file tree
Showing 36 changed files with 540 additions and 11 deletions.
Binary file modified Assets/Plugins/Android/Pojlib-debug.aar
Binary file not shown.
8 changes: 6 additions & 2 deletions Assets/Scenes/Main.unity
Original file line number Diff line number Diff line change
Expand Up @@ -7965,6 +7965,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ea87d112f0ba8ad439f17cb8309ff273, type: 3}
m_Name:
m_EditorClassIdentifier:
isMainScreen: 0
loginButtonText: {fileID: 1874211728}
handler: {fileID: 1460469781}
--- !u!1 &442830766
Expand Down Expand Up @@ -13398,6 +13399,8 @@ MonoBehaviour:
uiHandler: {fileID: 1460469782}
instancesDropdown: {fileID: 194192002}
configHandler: {fileID: 766335867}
loginHandler: {fileID: 432457120}
instanceButton: {fileID: 1460469786}
--- !u!4 &766335866
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -15130,7 +15133,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &844569212
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -30761,6 +30764,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ea87d112f0ba8ad439f17cb8309ff273, type: 3}
m_Name:
m_EditorClassIdentifier:
isMainScreen: 0
loginButtonText: {fileID: 460482964}
handler: {fileID: 1460469781}
--- !u!114 &1588127161
Expand Down Expand Up @@ -42145,7 +42149,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &2039886949
Transform:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/ConfigHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void LoadConfig()
string configFile = File.ReadAllText(configPath);
config = JsonConvert.DeserializeObject<Config>(configFile);

if (!config.acceptedLegal) { windowHandler.LegalSetter(); }
// if (!config.acceptedLegal) { windowHandler.LegalSetter(); }
if (config.setDevMods) { devHandler._devToggle.isOn = true; }
if (config.setCustomRAM)
{
Expand Down
16 changes: 15 additions & 1 deletion Assets/Scripts/JNIStorage.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
Expand All @@ -15,8 +16,16 @@ public class JNIStorage : MonoBehaviour
public UIHandler uiHandler;
public TMP_Dropdown instancesDropdown;
public ConfigHandler configHandler;
public LoginHandler loginHandler;
public InstanceButton instanceButton;


private void Start()
{
StartCoroutine(TestWait());
}

IEnumerator TestWait()
{
instance = this;

Expand All @@ -30,7 +39,12 @@ private void Start()
instancesObj = apiClass.CallStatic<AndroidJavaObject>("loadAll");
configHandler.LoadConfig();
UpdateInstances();
apiClass.SetStatic("model", OpenXRFeatureSystemInfo.GetHeadsetName());
apiClass.SetStatic("model", OpenXRFeatureSystemInfo.GetHeadsetName());
loginHandler.Login();

yield return new WaitForSeconds(30);

instanceButton.LaunchCurrentInstance();
}

private static void FillSupportedVersions(List<string> supportedVersions, string[] supportedVersionsArray)
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/LoginHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public class LoginHandler : MonoBehaviour
{
bool isMainScreen;
public bool isMainScreen;
private bool hasAttemptedLogin;
AndroidJavaClass javaClass;
AndroidJavaObject javaObject;
Expand Down Expand Up @@ -42,7 +42,7 @@ async Task LoadingButtonText()
hasAttemptedLogin = true;
}

private async void CheckVerification() {
public async void CheckVerification() {
if (Application.platform != RuntimePlatform.Android)
return;
while (isMainScreen == false)
Expand Down
1 change: 1 addition & 0 deletions Assets/XR/Settings/OpenXR Editor Settings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ MonoBehaviour:
Values:
- featureSets:
- com.meta.openxr.featureset.metaxr
- com.zappar.openxr.generic.featureset.loader
- featureSets:
- com.meta.openxr.featureset.metaxr
m_vulkanAdditionalGraphicsQueue: 0
30 changes: 26 additions & 4 deletions Assets/XR/Settings/OpenXR Package Settings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: feeef8d85de8db242bdda70cc7ff5acd, type: 3}
m_Name: OculusTouchControllerProfile Android
m_EditorClassIdentifier:
m_enabled: 1
m_enabled: 0
nameUi: Oculus Touch Controller Profile
version: 0.0.1
featureIdInternal: com.unity.openxr.feature.input.oculustouch
Expand Down Expand Up @@ -239,7 +239,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0f6bfdbcb316ed242b30a8798c9eb853, type: 3}
m_Name: KHRSimpleControllerProfile Android
m_EditorClassIdentifier:
m_enabled: 0
m_enabled: 1
nameUi: Khronos Simple Controller Profile
version: 0.0.1
featureIdInternal: com.unity.openxr.feature.input.khrsimpleprofile
Expand Down Expand Up @@ -496,7 +496,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 056125dd64c0ed540b40a4af74f7b495, type: 3}
m_Name: RuntimeDebuggerOpenXRFeature Android
m_EditorClassIdentifier:
m_enabled: 0
m_enabled: 1
nameUi: Runtime Debugger
version: 1
featureIdInternal: com.unity.openxr.features.runtimedebugger
Expand Down Expand Up @@ -601,6 +601,27 @@ MonoBehaviour:
priority: 0
required: 0
ignoreValidationErrors: 0
--- !u!114 &2058401042796469191
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 65e42b3b00c18334e89352c69c0add21, type: 3}
m_Name: GenericFeature Android
m_EditorClassIdentifier:
m_enabled: 1
nameUi: Generic Android Loader
version: 1.0.0
featureIdInternal: com.zappar.openxr.generic.loader
openxrExtensionStrings:
company: Zappar
priority: 0
required: 0
EnableTracker: 1
--- !u!114 &3038346838073451255
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -655,7 +676,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f647cc0545697264a9878224faada6d5, type: 3}
m_Name: MetaQuestFeature Android
m_EditorClassIdentifier:
m_enabled: 1
m_enabled: 0
nameUi: Meta Quest Support
version: 1.0.0
featureIdInternal: com.unity.openxr.feature.metaquest
Expand Down Expand Up @@ -750,6 +771,7 @@ MonoBehaviour:
- {fileID: 4716802777638266311}
- {fileID: -2866839366817237755}
- {fileID: -6114532943797586564}
- {fileID: 2058401042796469191}
- {fileID: -3276684023927252855}
- {fileID: -6584685598647757048}
- {fileID: -4735109778570369378}
Expand Down
8 changes: 8 additions & 0 deletions Packages/GenericOpenXRLoader/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions Packages/GenericOpenXRLoader/Editor/AndroidManifestProcess.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using System.Xml;
using UnityEditor.Build.Reporting;
using UnityEditor.XR.OpenXR.Features;

namespace Zappar.OpenXR.GenericAndroidLoader.Editor
{
internal class ModifyAndroidManfest : OpenXRFeatureBuildHooks
{
public override int callbackOrder => 1;

public override Type featureType => typeof(GenericFeature);

protected override void OnPostGenerateGradleAndroidProjectExt(string path)
{
//throw new NotImplementedException();
}

protected override void OnPostprocessBuildExt(BuildReport report)
{
//throw new NotImplementedException();
}

protected override void OnPreprocessBuildExt(BuildReport report)
{
//throw new NotImplementedException();
}
}

}
11 changes: 11 additions & 0 deletions Packages/GenericOpenXRLoader/Editor/AndroidManifestProcess.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Packages/GenericOpenXRLoader/Editor/GenericFeatureEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using UnityEditor;

namespace Zappar.OpenXR.GenericAndroidLoader.Editor
{
[CustomEditor(typeof(GenericFeature))]
public class GenericFeatureEditor : UnityEditor.Editor
{
private SerializedProperty enableTracker;

private void OnEnable()
{
enableTracker = serializedObject.FindProperty(nameof(GenericFeature.EnableTracker));
}

public override void OnInspectorGUI()
{
serializedObject.Update();

EditorGUILayout.PropertyField(enableTracker);

serializedObject.ApplyModifiedProperties();
}
}
}
11 changes: 11 additions & 0 deletions Packages/GenericOpenXRLoader/Editor/GenericFeatureEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Packages/GenericOpenXRLoader/Editor/GenericFeatureSet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using UnityEditor;
using UnityEditor.XR.OpenXR.Features;

namespace Zappar.OpenXR.GenericAndroidLoader.Editor
{
[OpenXRFeatureSet(
FeatureIds = new[]
{
GenericFeature.featureId,
},
UiName = "Generic OpenXR Support",
Description = "For targetting generic OpenXR compatible runtime on android",
FeatureSetId = "com.zappar.openxr.generic.featureset.loader",
SupportedBuildTargets = new BuildTargetGroup[] { BuildTargetGroup.Android }
)]
sealed class GenericFeatureSet
{
}
}
11 changes: 11 additions & 0 deletions Packages/GenericOpenXRLoader/Editor/GenericFeatureSet.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "com.zappar.openxr.genericandroidloader.editor",
"rootNamespace": "",
"references": [
"GUID:262f913ccd7417c46a908591bd2bb03e",
"GUID:4847341ff46394e83bb78fbd0652937e",
"GUID:96aa6ba065960476598f8f643e7252b6"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Packages/GenericOpenXRLoader/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2022 NFYNT©

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7 changes: 7 additions & 0 deletions Packages/GenericOpenXRLoader/LICENSE.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Packages/GenericOpenXRLoader/Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Packages/GenericOpenXRLoader/Runtime/Android.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions Packages/GenericOpenXRLoader/Runtime/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.DefaultCompany.OpenXRLoader"
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0">

<!-- Tell the system this app works in either 3dof or 6dof mode -->
<uses-feature
android:name="android.hardware.vr.headtracking"
android:required="false"
android:version="1" />

<!-- If building externally with the OpenXR AAR, this would be merged in automatically. -->
<uses-permission android:name="org.khronos.openxr.permission.OPENXR" />
<uses-permission android:name="org.khronos.openxr.permission.OPENXR_SYSTEM" />
<queries>
<provider android:authorities="org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" />
</queries>

</manifest>
Loading

0 comments on commit 1a374dd

Please sign in to comment.