ãUnity7ãåºãæµãã£ã©ãã¢ã¤ãã çãèªåçæããããï¼ã2Dãã¼ã°ã©ã¤ã¯4ã
Unity5.0.0f4 Personal(2015å¹´5æ)
ååã®ç¶ãã§ãã
Â
ååã§å°å½¢ãã¢ã¤ãã ã®ãã¬ãã¡ããå®æããã®ã§ãä»åã¯ããããçæããBoardManagerã¹ã¯ãªãããä½æãããã¨æãã¾ãã
Â
ãç®æ¨ããªãã¸ã§ã¯ããèªåçã«çæãããï¼
Â
2D Roguelike 4 of 14 : Board Manager - YouTube
Â
 ã¾ãã¯BoardManagerã¨GameManagerã¨ããååã®ã¹ã¯ãªãããScriptsãã©ã«ãã«ä½æãã¾ãã
Â
ã¹ã¯ãªããä½æ
Â
ç¶ãã¦GameManagerã¨ããååã®ç©ºãªãã¸ã§ã¯ããã²ã¨ã¤ä½æãã¦ããã¾ãã
Â
GameManagerãªãã¸ã§ã¯ãä½æ
Â
ããã§ã¯BoardManagerã¹ã¯ãªãããè¦ã¦ããã¾ãããã
Â
Â
ã½ã¼ã¹ã³ã¼ãã«ã³ã¡ã³ããæ¸ãã¦ãããã®ã§ããåç §ä¸ãããããã§ã¯ç°¡åãªæµãã®ã¿èª¬æãããã¨æãã¾ãã
Â
BoardManagerã¹ã¯ãªããã¯ãä¸çªä¸ã«ããSetupSceneã¡ã½ããããå§ã¾ãã¾ãã
Â
SetupSceneå ã§æåã«å¼ã°ããBoardSetupã¡ã½ããã«ã¦ãåºã¨å¤å£ãé ç½®ãã¦ããã¾ããå·¦ä¸ã(-1, -1)ãå³ä¸ã(8, 8)ã¨ãªã£ã¦ãããä¸çªå¤å´ã«å¤å£ããã以å¤ã«åºãé ç½®ãã¦ããã¾ãã
Â
Â
次ã®InitialiseListã¡ã½ããã§ã¯ãæµãã£ã©ã»å å£ã»ã¢ã¤ãã ãé ç½®ã§ããä½ç½®(gridPositions)ã決å®ãã¦ãã¾ããgridPositionsã¯6*6ã®ç¯å²ã¨ãªãã¾ãã
Â
Â
ç¶ãã¦LayoutObjectAtRandomã¡ã½ããã3åå¼ã°ãã¦ãã¾ããããã¯ï¼ã¤ç®ã§å å£ããï¼ã¤ç®ã§ã¢ã¤ãã ããï¼ã¤ç®ã§æµãã£ã©ãé ç½®ãã¦ãã¾ãã
Â
æå¾ã«(7, 7)ã®ä½ç½®ã«Exitãã¬ãã¡ããçæãã¦ãBoardManagerãçµãã¾ãã
Â
æµãéãã«èªã¿é²ã¿ãã³ã¡ã³ããåèã«ãã¦é ããã°ç解ã®å©ãã«ãªããã¨æãã¾ãã
Â
ä»åã¯ããã¾ã§ã§ãã
ãããã¨ããããã¾ããã
Â
ãUnityéçº7ãã¢ãã¡ã¼ã·ã§ã³ãä½ãããï¼ã2Dãã¼ã°ã©ã¤ã¯2ã
ãUnityéçº7ãFloorãã¢ã¤ãã ãä½æãããï¼ã2Dãã¼ã°ã©ã¤ã¯3ã
ãUnityéçº7ãBoardManagerãå¼ã³åºãGameManagerãä½æããã2Dãã¼ã°ã©ã¤ã¯5ã
ãUnityéçº7ãç ´å£å¯è½ãªå£(Wall)ãä½æãããï¼ããã¼ã°ã©ã¤ã¯7ã
ãUnityéçº7ããã¬ã¤ã¤ã¼ã®ã¢ãã¡ã¼ã¿ã¼ãè¨å®ãããï¼ããã¼ã°ã©ã¤ã¯8ã
ãUnityéçº7ããã¬ã¤ã¤ã¼ç¨ã®ã¹ã¯ãªãããè¨å®ãããï¼ããã¼ã°ã©ã¤ã¯9ã
ãUnityéçº7ãBGMã¨å¹æé³ãä»ããã2Dãã¼ã°ã©ã¤ã¯13ã
ãUnityéçº7ãã¿ããããã«ã«å¯¾å¿ããããï¼ã2Dãã¼ã°ã©ã¤ã¯14(Fin)ã
Â