Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UAAL example to support Gradle 8 in 2023.3.0b7+ #99

Merged
merged 2 commits into from
Feb 13, 2024
Merged
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
1 change: 1 addition & 0 deletions NativeAndroidApp/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies {


android {
namespace "com.unity.mynativeapp"
compileSdkVersion 33

defaultConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,21 @@ public void onClickShowUnity(View v) {
isGameActivity = !(v.getId() == R.id.show_unity_button);
disableShowUnityButtons();

Intent intent;
switch (v.getId()) {
case R.id.show_unity_button:
intent = new Intent(this, getMainUnityActivityClass());
break;

case R.id.show_unity_game_button:
intent = new Intent(this, getMainUnityGameActivityClass());
break;

default:
return;
int id = v.getId();
if (id == R.id.show_unity_button) {
startUnityWithClass(getMainUnityActivityClass());
} else if (id == R.id.show_unity_game_button) {
startUnityWithClass(getMainUnityGameActivityClass());
}
}

private void startUnityWithClass(Class klass)
{
Intent intent = new Intent(this, klass);
intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
startActivityForResult(intent, 1);
}


@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
Expand Down
2 changes: 1 addition & 1 deletion docs/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
This document explains how to include Unity as a Library into standard Android application through Activity. You can read more about [Unity as a Library](https://docs.unity3d.com/2019.3/Documentation/Manual/UnityasaLibrary.html).

**Requirements:**
- Android Studio Bumblebee (2021.1.1) or later
- Android Studio Hedgehog (2023.1.1) or later
- Unity version 2023.1.7f1, 2023.2.0b3 or later

[Note] For Unity versions from 2019.3.0b4 to 2022.2.0a17 use [19LTS-21LTS branch](https://github.com/Unity-Technologies/uaal-example/tree/uaal-example/19LTS-21LTS). For Unity versions from 2022.2.0a17 to 2023.1.0a16 use [22LTS branch](https://github.com/Unity-Technologies/uaal-example/tree/uaal-example/22LTS).
Expand Down