You're then presented with the workspace panels, which we'll also use in this tutorial. You can also modify the resolution that's being displayed in the Game panel. 5. Unity User Interfaceīefore we get started, make sure the 2D button in the Scene panel is not highlighted. You can do this in your favorite image editor. I've used the Adjust Size. function under the Tools menu in OS X's Preview application. 4. Export Graphicsĭepending on the devices you're targeting, you may need to convert the artwork to the recommended size and pixel density.
Unity pc build steps code#
Note that the code we'll write in this tutorial can be used to target any of the platforms.
Unity pc build steps android#
3.5" iPhone/iPod with Retina: 960px x 640pxīecause Android is an open platform, there's a wide range of devices, screen resolutions, and pixel densities.3.5" iPhone/iPod Touch without Retina: 320px x 480px.For example, the artwork needs to have a higher resolution if you're targeting an iPad with a retina display than a Lumia 520. This will help us select a proper size for the 3D textures and 2D GUI without making the artwork blurry or use textures that are too large for the target device. The first thing we need to do after selecting the target platform is choosing the size of the artwork we'll be using in the game. Set the project up for mobile development by choosing Build Settings from the File menu and selecting your platform of choice. In the next step, you're presented with Unity's user interface. Tell Unity where you want to save the project and set the Set up defaults for: menu to 3D. Open Unity and select New Project from the File menu to open the new project dialog. You will learn about the following aspects of Unity game development in this tutorial: The objective of the game is to throw the ball into the holes using the touch screen.
Unity pc build steps how to#
Exactly what you set may depend on your project, but can be an important step in making sure your UI scales correctly for you targets.In this tutorial, you'll learn how to create a mobile 3D game using C# and Unity. I often find anchoring the sides of an area, or corners, is best.įinally, depending on your platform and handled screen orientations, you can also set device orientation preferences in Player Preferences. It's hard to say what is the best way to anchor your UI elements generally speaking, but if you don't want them centred on the middle of the screen it likely isn't the default. This mode is the best for variable screen sizes, you can set this up to be your preferred screen size and then make your UI fit that size, then automatically scale based on your ideal size. The Canvas Scaler component can be found on your canvas object in the scene, and is the first place to start when dealing with variable screen sizes. The most important things from my experience are making sure you've anchored things as reasonably as you can, used layout groups for dynamic content (dropdowns, instantiated elements, etc.) and used the CanvasScaler component on your canvas. UI scaling is tricky particularly is you have different aspect ratios, and also if you have different resolutions ( although they are different).