Customizing for different platforms
Throughout this book, we have been developing and playing our game in the Unity Editor. In this section, we are going to start making some considerations regarding what will differ between the Android and PC versions of our game. For example, mobile devices have a touchscreen, so it would be useful if our game could detect that it's being played on a mobile device and, therefore, implement the correct controls.
Also, our game has been developed with a strict 1,920 x 1,080 resolution; we have introduced flexibility with the shop scene's UI and ensured that it accommodates various aspect ratios. In this section, we will go further and make our game support various aspect ratios.
Let's get started and modify our Player
script so that it supports touchscreen movement and fires on mobile devices.
Navigating and firing the player's ship with the touchscreen
In this section, we are going to revisit the Player
script and add...