Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Assets/DisplayCapture/Barcode/BarcodeReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ public Point(android.graphics.Point point) {

private UnityInterface unityInterface;

private record UnityInterface(String gameObjectName) {
private static class UnityInterface {
private final String gameObjectName;

private UnityInterface(String gameObjectName) {
this.gameObjectName = gameObjectName;
}

private void Call(String functionName) {
UnityPlayer.UnitySendMessage(gameObjectName, functionName, "");
}
Expand All @@ -66,13 +72,11 @@ public void OnBarcodeResults(String json) {
}

public BarcodeReader() {

var optBuilder = new BarcodeScannerOptions.Builder();
BarcodeScannerOptions.Builder optBuilder = new BarcodeScannerOptions.Builder();
optBuilder.setBarcodeFormats(Barcode.FORMAT_QR_CODE);
optBuilder.build();

scanner = BarcodeScanning.getClient(optBuilder.build());

gson = new Gson();
}

Expand Down Expand Up @@ -103,7 +107,7 @@ public void onNewImage(ByteBuffer byteBuffer, int width, int height, long timest
if(readingBarcode)
return;

var bitmap = Bitmap.createBitmap(
Bitmap bitmap = Bitmap.createBitmap(
width,
height,
Bitmap.Config.ARGB_8888
Expand All @@ -124,7 +128,7 @@ public void onNewImage(ByteBuffer byteBuffer, int width, int height, long timest
return;
}

var taskResult = task.getResult();
List<Barcode> taskResult = task.getResult();
Results results = new Results(taskResult.size());

Log.i(TAG, taskResult.size() + " barcodes found.");
Expand All @@ -137,7 +141,7 @@ public void onNewImage(ByteBuffer byteBuffer, int width, int height, long timest
result.text = barcode.getDisplayValue();
result.timestamp = timestamp;

var cornerPoints = Objects.requireNonNull(barcode.getCornerPoints());
android.graphics.Point[] cornerPoints = Objects.requireNonNull(barcode.getCornerPoints());
result.points = new Point[cornerPoints.length];
for(int j = 0; j < cornerPoints.length; j++)
result.points[j] = new Point(cornerPoints[j]);
Expand Down
9 changes: 7 additions & 2 deletions Assets/DisplayCapture/DisplayCaptureManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@ public class DisplayCaptureManager implements ImageReader.OnImageAvailableListen

private UnityInterface unityInterface;

private record UnityInterface(String gameObjectName) {
private static class UnityInterface {
private final String gameObjectName;

private UnityInterface(String gameObjectName) {
this.gameObjectName = gameObjectName;
}

private void Call(String functionName) {
UnityPlayer.UnitySendMessage(gameObjectName, functionName, "");
Expand Down Expand Up @@ -91,7 +96,7 @@ public void onPermissionResponse(int resultCode, Intent intent) {

Log.i(TAG, "Starting screen capture...");

var projectionManager = (MediaProjectionManager)
MediaProjectionManager projectionManager = (MediaProjectionManager)
UnityPlayer.currentContext.getSystemService(Context.MEDIA_PROJECTION_SERVICE);
projection = projectionManager.getMediaProjection(resultCode, intent);

Expand Down
4 changes: 2 additions & 2 deletions Assets/DisplayCapture/DisplayCaptureNotificationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import android.graphics.Color;
import android.os.IBinder;
import android.util.Log;
import com.unity3d.player.UnityPlayerForGameActivity;
import com.unity3d.player.UnityPlayerActivity;


public class DisplayCaptureNotificationService extends Service {
Expand All @@ -30,7 +30,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {

Intent activityIntent = new Intent(
this,
UnityPlayerForGameActivity.class);
UnityPlayerActivity.class);
activityIntent.setAction("stop");
PendingIntent contentIntent = PendingIntent.getActivity(
this,
Expand Down
3 changes: 2 additions & 1 deletion Assets/Plugins/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<!--ADD THESE LINES TO YOUR MANIFEST <APPLICATION> SECTION!!!-->


<activity android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode|density" android:excludeFromRecents="true" android:exported="true" android:hardwareAccelerated="false" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerGameActivity" android:resizeableActivity="false" android:screenOrientation="landscape" android:theme="@style/BaseUnityGameActivityTheme">
<activity android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenLayout|screenSize|uiMode|density" android:excludeFromRecents="true" android:exported="true" android:hardwareAccelerated="false" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity"
android:theme="@style/UnityThemeSelector" android:resizeableActivity="false" android:screenOrientation="landscape" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="com.oculus.intent.category.VR" />
Expand Down
52 changes: 43 additions & 9 deletions Assets/Plugins/Android/mainTemplate.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,47 @@
apply plugin: 'com.android.library'
apply from: '../shared/keepUnitySymbols.gradle'
// apply from: '../shared/keepUnitySymbols.gradle'
**APPLY_PLUGINS**

configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'androidx.appcompat') {
details.useVersion "1.5.1"
}
if (details.requested.group == 'androidx.core') {
details.useVersion "1.8.0"
}
if (details.requested.group == 'androidx.activity') {
details.useVersion "1.5.1"
}
if (details.requested.name == 'annotation-experimental') {
details.useVersion "1.2.0"
}
}
}
}

dependencies {



/* ADD THESE LINES TO YOUR GRADLE DEPENDENCIES SECTION */
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation('androidx.appcompat:appcompat:1.5.1') {
force = true
}
implementation('androidx.appcompat:appcompat-resources:1.5.1') {
force = true
}
implementation('androidx.core:core:1.8.0') {
force = true
}
implementation('androidx.core:core-ktx:1.8.0') {
force = true
}
implementation('androidx.activity:activity:1.5.1') {
force = true
}
implementation('androidx.annotation:annotation-experimental:1.2.0') {
force = true
}
implementation 'com.google.mlkit:barcode-scanning:17.3.0'
implementation 'com.google.code.gson:gson:2.11.0'
/* ADD THESE LINES TO YOUR GRADLE DEPENDENCIES SECTION */
Expand All @@ -22,17 +56,17 @@ android {
ndkPath "**NDKPATH**"
ndkVersion "**NDKVERSION**"

compileSdk **APIVERSION**
compileSdkVersion 32
buildToolsVersion = "**BUILDTOOLS**"

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

defaultConfig {
minSdk **MINSDK**
targetSdk **TARGETSDK**
minSdkVersion **MINSDKVERSION**
targetSdkVersion **TARGETSDKVERSION**
ndk {
abiFilters **ABIFILTERS**
debugSymbolLevel **DEBUGSYMBOLLEVEL**
Expand Down
8 changes: 4 additions & 4 deletions Assets/XR/Settings/OculusSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ MonoBehaviour:
OptimizeBufferDiscards: 1
PhaseSync: 1
SymmetricProjection: 1
SubsampledLayout: 0
SubsampledLayout: 1
FoveatedRenderingMethod: 0
LateLatching: 1
LateLatchingDebug: 0
EnableTrackingOriginStageMode: 0
SpaceWarp: 0
TargetQuest2: 1
TargetQuestPro: 1
SpaceWarp: 1
TargetQuest2: 0
TargetQuestPro: 0
TargetQuest3: 1
SystemSplashScreen: {fileID: 0}
UseStickControlThumbsticks: 0
2 changes: 0 additions & 2 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
"com.unity.collab-proxy": "2.5.2",
"com.unity.feature.development": "1.0.2",
"com.unity.mobile.android-logcat": "1.4.3",
"com.unity.multiplayer.center": "1.0.0",
"com.unity.timeline": "1.8.7",
"com.unity.ugui": "2.0.0",
"com.unity.visualscripting": "1.9.4",
"com.unity.xr.management": "4.5.0",
"com.unity.xr.oculus": "4.3.0",
"com.unity.modules.accessibility": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down
48 changes: 18 additions & 30 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "2.0.5",
"version": "1.0.6",
"depth": 2,
"source": "registry",
"dependencies": {},
Expand All @@ -55,9 +55,10 @@
"dependencies": {
"com.unity.ide.visualstudio": "2.0.22",
"com.unity.ide.rider": "3.0.31",
"com.unity.ide.vscode": "1.2.5",
"com.unity.editorcoroutines": "1.0.0",
"com.unity.performance.profile-analyzer": "1.2.2",
"com.unity.test-framework": "1.4.5",
"com.unity.test-framework": "1.1.33",
"com.unity.testtools.codecoverage": "1.2.6"
}
},
Expand All @@ -79,21 +80,20 @@
},
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.5",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.mobile.android-logcat": {
"version": "1.4.3",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.multiplayer.center": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.uielements": "1.0.0"
}
},
"com.unity.performance.profile-analyzer": {
"version": "1.2.2",
"depth": 1,
Expand All @@ -109,11 +109,11 @@
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.4.5",
"version": "1.1.33",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "2.0.3",
"com.unity.ext.nunit": "1.0.6",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
Expand All @@ -132,10 +132,11 @@
"com.unity.textmeshpro": {
"version": "3.0.6",
"depth": 1,
"source": "builtin",
"source": "registry",
"dependencies": {
"com.unity.ugui": "2.0.0"
}
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.8.7",
Expand Down Expand Up @@ -169,7 +170,7 @@
"url": "https://packages.unity.com"
},
"com.unity.xr.legacyinputhelpers": {
"version": "2.1.11",
"version": "2.1.10",
"depth": 1,
"source": "registry",
"dependencies": {
Expand Down Expand Up @@ -199,12 +200,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.modules.accessibility": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
Expand Down Expand Up @@ -252,12 +247,6 @@
"com.unity.modules.animation": "1.0.0"
}
},
"com.unity.modules.hierarchycore": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 0,
Expand Down Expand Up @@ -346,8 +335,7 @@
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.hierarchycore": "1.0.0"
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.umbra": {
Expand Down
Loading