ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2020ǯ11·î20Æü(¶â) 21:32:18ÍúÎò
¡¡¸½ºß¤Î¥²¡¼¥à¤¬¤É¤Î¤è¤¦¤Ê¿Ê¹Ô¾õ¶·¤Ç¤¢¤ë¤Î¤«¡¢¤É¤Î¥¨¥ê¥¢¤Ë¤¤¤ë¤Î¤«¤òÇÄ°®¤Ç¤¤Ê¤¤¤È¡¢¥²¡¼¥à¤ò¥µ¥¤¥¯¥ë²½¤¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£
¡¡
¡¡º£¤Þ¤Ç¤Î¼ê½ç¤Ç¥¨¥ê¥¢¤Î¾ðÊó¤òÅÐÏ¿¤·¡¢¤½¤ì¤ò¥²¡¼¥àÆâ¤ËÈ¿±Ç¤¹¤ë¼ÂÁõ¤ò¹Ô¤Ã¤Æ¤¤Þ¤·¤¿¡£
¡¡¥Ù¥ë¥È¥¹¥¯¥í¡¼¥ë¥¢¥¯¥·¥ç¥ó¤Ç¤Ï¡¢¥¨¥ê¥¢Ã±°Ì¤Ç¥²¡¼¥à¤¬¿Ê¹Ô¤·¤Æ¤¤¤¤Þ¤¹¤Î¤Ç¡¢¤³¤Î¥¨¥ê¥¢Æâ¤Î¥²¡¼¥à¤Î¿Ê¹Ô¾õÂÖ¤ò´ÉÍý¤Ç¤¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
³Æ¥¨¥ê¥¢¤Î¥µ¥¤¥¯¥ë²½¤¬¤Ç¤¤ì¤Ð¡¢¤¢¤È¤Ï¤½¤ì¤ò¥¨¥ê¥¢¤Î¿ô¤À¤±·«¤êÊÖ¤»¤Ð£±¤Ä¤Î¥¹¥Æ¡¼¥¸¤Ë¤Ê¤ê¤Þ¤¹¡£¡¡
¡¡£±¡¥GameManager¥¯¥é¥¹¤ò½¤Àµ¤¹¤ë(GameState(enum)¤òÄɲä·¡¢³Æ¥á¥½¥Ã¥ÉÆâ¤ËGameState¤Ë¤è¤ëʬ´ô¤òÄɲ乤ë) ¡¡£²¡¥¥²¡¼¥à¤ò¼Â¹Ô¤·¤ÆÆ°ºî¤ò³Îǧ¤¹¤ë
¡¡GamanManager¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤Æ¡¢¥²¡¼¥à¤Î¿Ê¹Ô¾õ¶·¤ò´ÉÍý¤¹¤ëenum¤Ç¤¢¤ëGameState¤ò¿·¤·¤¯ºîÀ®¤·¤Þ¤¹¡£
¡¡¤³¤ÎGameState¤ÎÎóµó»Ò¤Ë¤ÏWait¤äPlay¤È¤¤¤Ã¤¿¡¢¥²¡¼¥à¤Î¾õ¶·¤òɽ¸½¤¹¤ëÃͤòÍÑ°Õ¤·¡¢¤½¤ì¤ò´ÉÍýÍѤÎÊÑ¿ô¤ËÂåÆþ¤·¤Æ¥²¡¼¥à¤Î¿Ê¹Ô¾õ¶·¤ò´ÉÍý¤µ¤»¤Þ¤¹¡£
¤³¤¦¤¹¤ë¤³¤È¤Ç¥²¡¼¥à¤Î¾õÂÖ¤ò°ì¸µ²½¤·¤Æ´ÉÍý¤Ç¤¤Þ¤¹¡£¡ÊÊ£¿ô¤Î°Û¤Ê¤ë¥²¡¼¥à¾õÂÖ¤¬½Å¤Ê¤ë¤³¤È¤¬¤Ê¤¯¤Ê¤ë¡Ë
¡¡¥²¡¼¥à¤Î¿Ê¹Ô¾õ¶·¤ÎÀ©¸æ½èÍý¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£¤¹¤Ù¤ÆGamanManagerÆâ¤ÇÀ©¸æ¤ò¹Ô¤¦¤³¤È¤Ç½èÍý¤ò´ÉÍý¤·¤ä¤¹¤¯¤·¤Æ¤¤¤Þ¤¹¡£
£±¡¥InitStage¥á¥½¥Ã¥ÉÆâ¤Ë½èÍý¤òÄɲä·¡¢GameState¤òWait¾õÂÖ¤ËÊѹ¹¤¹¤ë½èÍý¤òÄɲ乤롣 ¡¡¡¡¡¡¢ £²¡¥Update¥á¥½¥Ã¥ÉÆâ¤Ë½èÍý¤òÄɲä·¡¢GameState¤¬Wait¾õÂ֤Ǥϥ᥽¥Ã¥ÉÆâ¤Î½èÍý¤¬¼Â¹Ô¤µ¤ì¤Ê¤¤¤è¤¦¤ËÄä»ß¤¹¤ëÀ©¸æ½èÍý¤òÄɲä¹¤ë ¡¡¡¡¤Þ¤¿GameState¤¬Move¤Î»þ¤Ë¤Ï¥¥ã¥é¤Î°ÌÃÖ¤ò´Æ»ë¤·¤Æ¼¡¤Î¥¨¥ê¥¢¤ÎȽÄê¤ò¹Ô¤¦½èÍý¤òÄɲä¹¤ë ¡¡¡¡¡¡¢ £³¡¥SetUpNextArea¥á¥½¥Ã¥ÉÆâ¤Î½èÍý¤òÄɲä·¡¢¥¨¥ê¥¢¤ÎÀßÄ꤬½ªÎ»¤·¤¿Ãʳ¬¤ÇGameState¤òPlay¤Î¾õÂÖ¤ËÊѹ¹¤¹¤ë½èÍý¤òÄɲä¹¤ë ¡¡¡¡¡¡¢ £´¡¥GameState¤¬Play¤Ë¤Ê¤Ã¤¿¤Î¤Ç¡¢Ää»ß¤·¤Æ¤¤¤¿Update¥á¥½¥Ã¥ÉÆâ¤Î½èÍý¤¬Æ°¤»Ï¤á¤ë¡ÊŨ¤ÎÀ¸À®¤¬¹Ô¤ï¤ì¤ë¡Ë ¡¡¡¡¡¡¢ £µ¡¥CheckAreaClear¥á¥½¥Ã¥ÉÆâ¤ÎȽÄê¤ÇdestroyCount¤¬³Æ¥¨¥ê¥¢¤ÎÀ¸À®¿ô¤Ë㤷¤¿¾ì¹ç¡¢¥¨¥ê¥¢¥¯¥ê¥¢¤È¤Ê¤êGameState¤¬Move¤ËÊѹ¹¤Ë¤Ê¤ê¡¢¼¡¤Î¥¨¥ê¥¢¤Ø°ÜÆ°¤Ç¤¤ë¤è¤¦¤Ë¤Ê¤ë ¡¡¡¡¡¡¢ £¶¡¥¡Ú£²¡Û¤ÎUpdate¥á¥½¥Ã¥É¤ËÄɲä·¤¿GameData¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬Move¾õÂ֤κݤΰÜÆ°½èÍý¤¬È½Äꤵ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¡¢¼¡¤Î¥¨¥ê¥¢¤Ø°ÜÆ°¤¹¤ë¤ÈGameState¤¬Wait¤Ë¤Ê¤ê¡¢¡Ú£³¡Û¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë ¡¡¡¡¡¡¢ £·¡¥¥¨¥ê¥¢¤Î¿ô¤À¤±¡Ú£³¡Û¡Á¡Ú£¶¡Û¤ò·«¤êÊÖ¤¹
¡¡¤³¤Î¤è¤¦¤ÊÀ©¸æ¤ò¹Ô¤¦¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡¤½¤ì¤Ç¤ÏGameManager¥¯¥é¥¹¤ò½¤Àµ¤·¤Æ¡¢Àë¸À¥Õ¥£¡¼¥ë¥É¤ËGameState(enum)¤òÄɲä·¡¢¥²¡¼¥à¤Î¾õÂÖ¤òÅÐÏ¿¤·¤Þ¤¹¡£
¤Þ¤¿¡¢¤³¤Îenum¤ò´ÉÍý¤¹¤ëÊÑ¿ô¤ò£±¤ÄÍÑ°Õ¤·¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤ÎÃͤ¬¸½ºß¤Î¥²¡¼¥à¤Î¾õÂ֤ˤʤê¤Þ¤¹¡£
¡¡³Æ¥á¥½¥Ã¥ÉÆâ¤ËGameState¤Ë¤è¤ëʬ´ô¤òÄɲ䷤Ƥ¤¤¤Þ¤¹¡£Äɲ乤ëÉôʬ¤¬Â¿¤¤¤Î¤Ç¡¢GameManager¥¯¥é¥¹¤òÁ´Ê¸·ÇºÜ¤·¤Þ¤¹¡£
½ñ¤±Ì¤é¤·¤¬¤¢¤ë¤ÈÀµ¾ï¤ËÆ°ºî¤·¤Þ¤»¤ó¤Î¤Ç¡¢¤â¤·¤âʬ´ô¤Î¥¿¥¤¥ß¥ó¥°¤ÇGameState¤¬Êѹ¹¤Ë¤Ê¤é¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÁ°¸å¤Î½èÍý¤ò³Îǧ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
GameManager.cs
¡¡½¤Àµ¤¬½ªÎ»¤·¤¿¤é¡¢GameManager¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¡¢GameManager¤ò¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤Ç³Îǧ¤·¤Þ¤¹¡£
GameState¤òÅÐÏ¿¤¹¤ë¥¢¥µ¥¤¥ó¾ðÊó¤¬Äɲ䵤ì¤Æ¤ª¤ê¡¢¥×¥ë¥À¥¦¥ó¥á¥Ë¥å¡¼¤Çenum½¤¾þ»Ò(Play¡¢Move¡¢Wait)¤òÀßÄê½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£
GameManager¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¸¡¾ÚÆ°²è¡¡GameState
https://gyazo.com/a1f90870456cc7546d450b02ff244ff7
¡¡GameState¤ÎÃͤϥ²¡¼¥à¤Î¼Â¹Ô¤ÈƱ»þ¤Ë Wait ¤ËÀßÄꤵ¤ì¤ë¤è¤¦¤ËÀ߷פ·¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤¤¤º¤ì¤ÎÃͤˤʤäƤ¤¤Æ¤âÌäÂê¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¡¡GameState¤Î³ÆÊѹ¹¤Î¥¿¥¤¥ß¥ó¥°¤ËDebug.Log¤òÆþ¤ì¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¥²¡¼¥à¤Î¿Ê¹Ô¾õ¶·¤ò¥í¥°¤â¹ç¤ï¤»¤Æ³Îǧ¤·¤Ê¤¬¤éÆ°ºî¤ò¸¡¾Ú¤·¤Þ¤¹¡£
¡¡¥²¡¼¥à¤Î¼Â¹Ô¸å¡¢Wait => Play ¤ËÀÚ¤êÂؤï¤ê¤Þ¤¹¡£Wait => Play ¤Ø¤Ï¤Û¤Ü°ì½Ö¤ÇÀÚ¤êÂؤï¤ê¤Þ¤¹¡£
¸¡¾ÚÆ°²è¡
https://gyazo.com/3cd07beb992795879ec8d2c1f0a6b570
¡¡¥¨¥ê¥¢Æâ¤ÎŨ¤ò¤¹¤Ù¤ÆÅݤ¹¤È Play => Move ¤ËÀÚ¤êÂؤï¤ê¡¢¼¡¤Î¥¨¥ê¥¢¤Ø°ÜÆ°¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¼¡¤Î¥¨¥ê¥¢¤Ø°ÜÆ°¤¹¤ë¤È Move => Wait ¤Ø¤ÈÀÚ¤êÂؤï¤ê¡¢¼¡¤Î¥¨¥ê¥¢¤Î¾ðÊó¤¬ÀßÄꤵ¤ì¡¢¤½¤ì¤¬´°Î»¤¹¤ë¤Þ¤ÇUpdate¤¬°ì»þŪ¤ËÄä»ß¤·¤Þ¤¹¡£
¤½¤·¤Æ¤Þ¤¿ Wait =>Play ¤ØÀÚ¤êÂؤï¤ê¡¢¼¡¤Î¥¨¥ê¥¢¤¬³«»Ï¤µ¤ì¤Þ¤¹¡£
¸¡¾ÚÆ°²è¢¡¡Move => Wait => Play
https://gyazo.com/3dddb6af53724e9fca2b1943e1bd9676
¡¡¤³¤ì¤Ç̵»ö¤Ë¥¨¥ê¥¢¤Î¿Ê¹Ô¤ò¥µ¥¤¥¯¥ë²½½ÐÍè¤Þ¤·¤¿¡£¤Ä¤Ê¤²¤ë¤³¤È¤Ç£±¤Ä¤Î¥¹¥Æ¡¼¥¸¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯