Book Image

Learning Unity iOS Game Development

Book Image

Learning Unity iOS Game Development

Overview of this book

Table of Contents (14 chapters)
Learning Unity iOS Game Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
6
Main Menu, iAds, Leaderboards, Store Purchases, and Achievements
Index

Creating the character controller


These settings allow the sprite sheet to be animated, have the same detail as the normal image, and keep the max file size down by limiting the max texture sheet size to 1024 pixels.

Next, we need to update the sprite sheet so that it knows the boundaries for each of the animation frames in the sheet. To perform this, in Inspector, click on Sprite Editor.

This is designed to help us break the image based on the X and Y values we want to. For example, if each frame of the animation is 32 pixels wide on X and 32 pixels wide on Y, we can use the Sprite Editor to cut the image into smaller images based on that size.

  1. In Sprite Editor, click on Slice in the top-left corner of the window.

  2. Select Type as Grid.

  3. Select Pixel Size on X as 32 and Y as 32.

  4. Leave Offset and Padding as 0.

  5. Change the Pivot to Top Left.

  6. Then, click on Slice:

This should result in the image being sliced into 32 x 32 boxes across the whole image. Take a look at the following image:

The major issue...