2019의 게시물 표시

How to create tilemap in Unity2D

이미지
1. Select GameObject > 2D Object > Tilemap in unity menu.



2. GameObject "Grid" and "Tilemap" will be created as below



3. Select Window > 2D > Tile Palette in menu



4. Select "Create New Select" as below screen shot and then create new palette



5. Select folder to store palette file

6. Register tile image as below



7. In Tile Palette window, select tile brush and "Paint a filled box with active brush" tool (center icon) in tool bar

8. Go to the Scene window. You can see grid as below



9. Drag tile on the grid of Scene window to create tile map


Move character

1. Move 2D sprite image using virtual joystick in Unity.
2. I used CrossPlatformInputManager of Unity Standard Asset for joystick script.

using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityStandardAssets.CrossPlatformInput;publicclassPlayerScript: MonoBehaviour {public