This commit is contained in:
2026-01-17 10:50:20 +01:00
parent e7a514a713
commit bced7d7666
16 changed files with 424 additions and 11 deletions

View File

@@ -147,9 +147,8 @@ UnityPluginLoad(IUnityInterfaces* unityInterfaces)
Logger::Log("UnityPluginLoad: Vulkan initialization failed, falling back to OpenGL");
}
// Fall back to OpenGL for GLES renderers
if (g_rendererType == kUnityGfxRendererOpenGLES20 ||
g_rendererType == kUnityGfxRendererOpenGLES30)
// Fall back to OpenGL for GLES renderer (Unity 6+ only supports GLES 3.0+)
if (g_rendererType == kUnityGfxRendererOpenGLES30)
{
g_backend = std::make_unique<OpenGLTextureBackend>();
Logger::Log("UnityPluginLoad: Using OpenGL backend");

View File

@@ -0,0 +1,54 @@
fileFormatVersion: 2
guid: 092ff7f6b468e514dab68477b30f4be9
PluginImporter:
externalObjects: {}
serializedVersion: 3
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
Android:
enabled: 0
settings:
AndroidLibraryDependee: UnityLibrary
AndroidSharedLibraryType: Executable
CPU: ARMv7
Any:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Editor:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux64:
enabled: 0
settings:
CPU: x86_64
OSXUniversal:
enabled: 0
settings:
CPU: None
Win:
enabled: 0
settings:
CPU: x86
Win64:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,54 @@
fileFormatVersion: 2
guid: 8beb8fd09587222468253575f4948166
PluginImporter:
externalObjects: {}
serializedVersion: 3
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
Android:
enabled: 0
settings:
AndroidLibraryDependee: UnityLibrary
AndroidSharedLibraryType: Executable
CPU: ARMv7
Any:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Editor:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux64:
enabled: 0
settings:
CPU: x86_64
OSXUniversal:
enabled: 0
settings:
CPU: None
Win:
enabled: 0
settings:
CPU: x86
Win64:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,54 @@
fileFormatVersion: 2
guid: dee5496676a3922418f28bb82b40deb2
PluginImporter:
externalObjects: {}
serializedVersion: 3
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
Android:
enabled: 0
settings:
AndroidLibraryDependee: UnityLibrary
AndroidSharedLibraryType: Executable
CPU: ARMv7
Any:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Editor:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux64:
enabled: 0
settings:
CPU: x86_64
OSXUniversal:
enabled: 0
settings:
CPU: None
Win:
enabled: 0
settings:
CPU: x86
Win64:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,54 @@
fileFormatVersion: 2
guid: d9d24fbb4dd465f4a94e1e6cca970a1b
PluginImporter:
externalObjects: {}
serializedVersion: 3
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
Android:
enabled: 0
settings:
AndroidLibraryDependee: UnityLibrary
AndroidSharedLibraryType: Executable
CPU: ARMv7
Any:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Editor:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux64:
enabled: 0
settings:
CPU: x86_64
OSXUniversal:
enabled: 0
settings:
CPU: None
Win:
enabled: 0
settings:
CPU: x86
Win64:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -3,6 +3,7 @@
#include "texture_backend.h"
#include <vulkan/vulkan.h>
#include <vulkan/vulkan_android.h>
#include <IUnityRenderingExtensions.h>
#include <IUnityGraphicsVulkan.h>
/**

View File

@@ -0,0 +1,54 @@
fileFormatVersion: 2
guid: a9e35fcc5dd576f5b95f2f7ddb081b2c
PluginImporter:
externalObjects: {}
serializedVersion: 3
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
Android:
enabled: 0
settings:
AndroidLibraryDependee: UnityLibrary
AndroidSharedLibraryType: Executable
CPU: ARMv7
Any:
enabled: 0
settings:
Exclude Android: 1
Exclude Editor: 1
Exclude Linux64: 1
Exclude OSXUniversal: 1
Exclude WebGL: 1
Exclude Win: 1
Exclude Win64: 1
Editor:
enabled: 0
settings:
CPU: AnyCPU
DefaultValueInitialized: true
OS: AnyOS
Linux64:
enabled: 0
settings:
CPU: x86_64
OSXUniversal:
enabled: 0
settings:
CPU: None
Win:
enabled: 0
settings:
CPU: x86
Win64:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -48,16 +48,46 @@ Packages/com.omarator.mosissdk/
## Build Commands
### Unity Build
### Unity Build (Export to Android Studio)
Unity exports a Gradle project which is then built in Android Studio:
1. File > Build Settings
2. Switch Platform to Android
3. Player Settings > Other Settings:
- Scripting Backend: IL2CPP
- Target Architectures: ARM64
- Graphics APIs: Vulkan, OpenGLES3 (in order of preference)
- Minimum API Level: 29
4. Build or Build and Run
4. Check "Export Project"
5. Click Export and select output folder (e.g., `D:\Dev\Mosis\Builds\Unity\Android\MosisVR`)
### Native Plugin Build
### Build Gradle Project
After exporting from Unity:
```batch
cd D:\Dev\Mosis\Builds\Unity\Android\MosisVR
gradle assembleRelease
:: APK will be at:
:: launcher\build\outputs\apk\release\launcher-release.apk
```
Or open in Android Studio and build from there.
### Command Line Export (Optional)
```batch
"C:\Program Files\Unity\Hub\Editor\6000.3.2f1\Editor\Unity.exe" ^
-batchmode -quit -nographics ^
-projectPath "D:\Dev\Mosis\MosisVR" ^
-executeMethod BuildScript.BuildAndroidCI ^
-outputPath "D:\Dev\Mosis\Builds\Unity\Android\MosisVR" ^
-logFile "D:\Dev\Mosis\Builds\Unity\build.log"
```
### Native Plugin Build (Manual)
To rebuild the native library manually: