AirConsole / airconsole-unity-plugin

A plugin for Unity to develop for AirConsole
http://developers.airconsole.com/#/guides/unity
GNU Lesser General Public License v3.0
69 stars 19 forks source link

Now all cameras are resized with the AndroidTV UI #33

Closed Undume closed 2 months ago

Undume commented 3 years ago

I was porting my game "com.ecantalejos.rgbblocks" to Android TV and I had problems with the "Android UI resize mode" because I have a nested scene with "another Main.camera" in the nested one.

So I changed only resizing the Camera.pixelRect from Main.camera to resize all the cameras with the AndroidUI in mind.

Undume commented 3 years ago

I don't know what happened with the formatting of the OnSceneLoaded(), in my file is well tabbed.

daniel-n-dream commented 3 years ago

Hi @Undume, thanks for the PR! Could you share a basic Unity project where you encounter the issue so that I can better understand what this PR is fixing? That would be much appreciated, thank you!

marc-n-dream commented 10 months ago

Thank you for the PR @Undume

This is an interesting problem. The proposed solution would not work as a general take as it would interfere with splitscreen games that do not use stacked layered cameras.

If you have an example I would like to use it as one of several test cases to improve the functionality here as I agree that the automatic resizing can and should give developers to do more.

Otherwise I would instead propose that the plugin would best be expanded to

  1. collect all the fullscreen cameras that are in the same hierarchy as the main camera (direct parents and all children) that are fullscreen after a few frames in a new scene
  2. Update that list of cameras
  3. Log this operation so developers are aware that it is taking place to improve bug analysis
marc-n-dream commented 2 months ago

Closing this. As part of the effort to bring AirConsole to Android Automotive, the related functionality will be improved and extended to handle more cases and lay the base for more complex setup.