Unity-Technologies / uaal-example

Other
733 stars 233 forks source link

[UUM-20370] Update how to get FrameLayout in addControlsToUnityFrame() in MainUnityActivity.java #84

Closed VeryHappyYoung closed 11 months ago

VeryHappyYoung commented 1 year ago

Purpose of this PR

Jira link: https://jira.unity3d.com/browse/UUM-20370

\ The issue: Before introducing GameActivity for Android in 2023.1, the way you get FrameLayout was updated.

In 2022.2, UnityPlayer extends FrameLayout.

Screenshot 2023-06-08 at 18 32 44

In 2023.1 UnityPlayer doesn't extend FrameLayout. Instead, it offers getFrameLayout() API

Screenshot 2023-06-08 at 18 33 52 Screenshot 2023-06-08 at 18 38 11

\ \ Solution: Use mUnityPlayer.getFrameLayout() instead of mUnityPlayer

\ Note: Make sure that Activity is selected and GameActivity is not selected as the Application Entry Point in Player Settings (Android)

Screenshot 2023-06-08 at 18 29 47

VeryHappyYoung commented 1 year ago

Yes, you are correct. I wanted you to check if everything is all right. Thank you so much!