ãUnityã2Dã¿ã¤ã«ãããâ åºæ¬çãªä½¿ãæ¹
Unity 2020.2.1f1 Personal(2021å¹´3æ)
ä¹
ã
ã®æ´æ°ã§ãï¼
Unityã®æ¨æºæ©è½ã®2Dã¿ã¤ã«ãããã®ä½¿ãæ¹ããç´¹ä»è´ãã¾ãã
2Dã¿ã¤ã«ãããã¨ã¯
2Dã¿ã¤ã«ãããã¯ã°ãªããã«ã¿ã¤ã«ãè¨å®ãã¦ã¹ãã¼ã¸ãæ§ç¯ããã·ã¹ãã ã§ãã
ã¹ã¼ãã¼ããªãªãã©ã¶ã¼ãºãªã©ã®æ¨ªã¹ã¯ãã¼ã«ã¢ã¯ã·ã§ã³ã²ã¼ã ãã
ã·ã ã·ãã£ãªã©ã®æãä¸ããè¦ä¸ãããã²ã¼ã ãªã©ã§ã
2Dã¿ã¤ã«ãããã¯ä½¿ããã¦ãã¾ãã
Unityã§ã¯2017.2ãã¼ã¸ã§ã³ããå®è£
ããã¾ããã
ã¹ãã©ã¤ããæºåãã
ä»åã¯64px * 64pxã®ã¹ãã©ã¤ãã2ã¤ç¨æãã¾ããã
tatami.png
rouka.png
ä¸å¿tatami.pngãç³ãrouka.pngãå»ä¸ã¨ãããã¨ã§ã»ã»ã»å ¨ãè¦ããªãã§ããç¬
ãã¡ãã®ç»åãUnityã«ã¢ãããã¾ãã
ã¢ãããå®äºããããã¹ãã©ã¤ãã®è¨å®ãè¡ã¾ãã
ã¾ãã¯Sprite Mode > Pixels Per Unitã64ã«å¤æ´ãã¾ãã
2Dã¿ã¤ã«ãããã§ã¯ã¿ã¤ã«ï¼ã¤åã1Unitã¨ãã¦æ±ãããã
å¹
ã64pxã®ã¹ãã©ã¤ãã®å ´åã¯64ã¨åããã¦ããã¾ãã
ç¶ãã¦Filter ModeãPoint (no filter)ã«å¤æ´ãã¾ãã
ãã¯ã»ã«ã綺éºã«è¡¨ç¤ºããã¾ãã(ç»åã«ãã£ã¦ã¯å¿
é ã§ã¯ããã¾ããã)
TilePaletteã®ä½æ
ç¶ãã¦TilePaletteã§ãã
çµµã®å
·ã®ãã¬ããã«çµµã®å
·ãåºãã¦å¥½ããªè²ãé¸ã¶ããã«ã
TilePaletteã«ã¹ãã©ã¤ããåºãã¦ä½¿ã£ã¦ããã¾ãã
ã¾ãã¯TilePaletteãä½æãã¾ãã
Window > 2D > Tile Paletteããã¿ã¤ã«ãã¬ããã¦ã¤ã³ãã¦ãéãã¾ãã
ç¶ãã¦Create New Paletteãæ¼ãã
Nameã«å¥½ããªãã¬ããåï¼ä»åã¯ãFieldPaletteãï¼ãå
¥åã
Createãã¿ã³ã§TilePaletteãä½æãã¾ãã
æå®ããå ´æã«ãã¬ãããä¿åããã¾ãã
TilePaletteã®è¨å®
ç¶ãã¦ä½æããTIlePaletteã«tatami.pngã¨rouka.pngãé
ç½®ãã¾ãã
ãã®ã¾ã¾ãã©ãã°&ããããããã°é
ç½®ããã¾ãã
ãã®éåã³ä¿åå
ãèããã¾ãã
å
ã»ã©ã¯TilePaletteã®ä¿åå
ã§ããããä»åã¯Tileã¢ã»ããã®ä¿åå
ã§ãã
ãã®Tileã¢ã»ãããSceneä¸ã«ä¸¦ã¹ããã¨ã§2Dã¿ã¤ã«ããããè¡ãã¾ãã
ãã¬ããã«Tileã¢ã»ãããé
ç½®ããã
TileMapãä½æãã
2Dã¿ã¤ã«ãããã¯TilePaletteã«é
ç½®ããTileã¢ã»ããã
TileMapã«é
ç½®ãã¦ããã¨ããã®ãåºæ¬çãªæµãã§ãã
ã¨ããããã§ãã¬ããã¯ä¸æ¦ç½®ãã¦ãããTileMapãä½æãã¦ããã¾ãã
HierarchyããCreate > 2D Object > TileMap > Rectangularãé¸æãã
TileMapãªãã¸ã§ã¯ããä½æãã¾ãã
(Gridãªãã¸ã§ã¯ãã®åãªãã¸ã§ã¯ãã®å½¢ã§ä½æããã¾ãã)
ã¡ãªã¿ã«Rectangularã¨ã¯é·æ¹å½¢ã¨ããæå³ã§ãä»ã®Hexagonalã¯å
è§å½¢ã
Isometricã¯ã·ã ã·ãã£ã®ããã«æãä¸ããè¦ä¸ãããå½¢ãæå³ãã¾ãã
TileMapã«Tileãå¡ã
ããããTileMapã«Tileãå¡ã£ã¦ããã¾ãã
TilePaletteã®ã¢ã¼ãããã©ã·ã«ãã
tatamiã®Tileãé¸æãã¾ãã
ãã®ç¶æ
ã§Sceneãã¥ã¼ãéãã¨ã
TileMapã«Tileãå¡ããç¶æ
ã¨ãªã£ã¦ãã¾ãã
Gameãã¥ã¼ã§ã¯ãªãSceneãã¥ã¼ã§ããç¹ã«æ³¨æ
好ããªããã«Tileãå¡ã£ã¦ããã
TilePaletteã®æ¶ãã´ã ãé¸æãã¦Tileãæ¶ããªã©ãã¦
TIleMapãæ´ãã¦ããã¾ãã
æ¶ãã´ã ã¢ã¼ã
TilePaletteã§å¥Tileãé¸æããã¨å¥TIleã§å¡ããã¨ãã§ãã¾ãã
æ¶ãã´ã ã¢ã¼ãã使ã£ãå ´åã¯ãã©ã·ã¢ã¼ãã«æ»ãã¦ãã ããã
å¥Tileãå¡ã
ã¡ãªã¿ã«Sceneãã¥ã¼ã«ã¦Tileãå転ããããã¨ãã§ãã¾ãã
ã[ããã¼ã§å·¦åããã]ããã¼ã§å³åãã§ãã
Tileãå転ããã¦æç»
ã¨ããããã§ä»åã¯2Dã¿ã¤ã«ãããã®åºæ¬çãªä½¿ãæ¹ããç´¹ä»ãã¾ããã
ããå°ãçªã£è¾¼ãã 使ãæ¹ãç´¹ä»ãã¦ãããã°ã¨æãã¾ãã
ãããã¨ããããã¾ãããã