Unity¤Ë´ØÏ¢¤¹¤ëµ­»ö¤Ç¤¹



Àß·×

¡¡
¡¡¸½ºß¤Î¥²¡¼¥à¤¬¤É¤Î¤è¤¦¤Ê¿Ê¹Ô¾õ¶·¤Ç¤¢¤ë¤Î¤«¡¢¤É¤Î¥¨¥ê¥¢¤Ë¤¤¤ë¤Î¤«¤òÇÄ°®¤Ç¤­¤Ê¤¤¤È¡¢¥²¡¼¥à¤ò¥µ¥¤¥¯¥ë²½¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
¡¡
¡¡º£¤Þ¤Ç¤Î¼ê½ç¤Ç¥¨¥ê¥¢¤Î¾ðÊó¤òÅÐÏ¿¤·¡¢¤½¤ì¤ò¥²¡¼¥àÆâ¤ËÈ¿±Ç¤¹¤ë¼ÂÁõ¤ò¹Ô¤Ã¤Æ¤­¤Þ¤·¤¿¡£

¡¡¥Ù¥ë¥È¥¹¥¯¥í¡¼¥ë¥¢¥¯¥·¥ç¥ó¤Ç¤Ï¡¢¥¨¥ê¥¢Ã±°Ì¤Ç¥²¡¼¥à¤¬¿Ê¹Ô¤·¤Æ¤¤¤­¤Þ¤¹¤Î¤Ç¡¢¤³¤Î¥¨¥ê¥¢Æâ¤Î¥²¡¼¥à¤Î¿Ê¹Ô¾õÂÖ¤ò´ÉÍý¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
³Æ¥¨¥ê¥¢¤Î¥µ¥¤¥¯¥ë²½¤¬¤Ç¤­¤ì¤Ð¡¢¤¢¤È¤Ï¤½¤ì¤ò¥¨¥ê¥¢¤Î¿ô¤À¤±·«¤êÊÖ¤»¤Ð£±¤Ä¤Î¥¹¥Æ¡¼¥¸¤Ë¤Ê¤ê¤Þ¤¹¡£¡¡


¼ÂÁõ¤Î¼ê½ç


¡¡£±¡¥GameManager¥¯¥é¥¹¤ò½¤Àµ¤¹¤ë(GameState(enum)¤òÄɲä·¡¢³Æ¥á¥½¥Ã¥ÉÆâ¤ËGameState¤Ë¤è¤ëʬ´ô¤òÄɲ乤ë)
¡¡£²¡¥¥²¡¼¥à¤ò¼Â¹Ô¤·¤ÆÆ°ºî¤ò³Îǧ¤¹¤ë


¿·¤·¤¯³Ø½¬¤¹¤ëÆâÍÆ


¡¡¡¦enum¤òÍøÍѤ·¤¿¥²¡¼¥à¾õÂ֤δÉÍýÊýË¡¤È¡¢¤½¤ì¤òÍѤ¤¤¿¥²¡¼¥à¤Î¿Ê¹ÔÊýË¡


¡ãenum¤òÍøÍѤ·¤¿¥²¡¼¥à¾õÂ֤δÉÍýÊýË¡¤È¡¢¤½¤ì¤òÍѤ¤¤¿¥²¡¼¥à¤Î¿Ê¹ÔÊýË¡¡ä


¡¡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¥¯¥é¥¹¤ò½¤Àµ¤¹¤ë


¡¡¤½¤ì¤Ç¤Ï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


¡¡¤³¤ì¤Ç̵»ö¤Ë¥¨¥ê¥¢¤Î¿Ê¹Ô¤ò¥µ¥¤¥¯¥ë²½½ÐÍè¤Þ¤·¤¿¡£¤Ä¤Ê¤²¤ë¤³¤È¤Ç£±¤Ä¤Î¥¹¥Æ¡¼¥¸¤Ë¤Ê¤ê¤Þ¤¹¡£


¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£

¥³¥á¥ó¥È¤ò¤«¤¯


¡Öhttp://¡×¤ò´Þ¤àÅê¹Æ¤Ï¶Ø»ß¤µ¤ì¤Æ¤¤¤Þ¤¹¡£

ÍøÍѵ¬Ìó¤ò¤´³Îǧ¤Î¤¦¤¨¤´µ­Æþ²¼¤µ¤¤

Menu


´ðÁÃ

µ»½Ñ/Ãμ±(¼ÂÁõÎã)

3D¥¢¥¯¥·¥ç¥ó¥²¡¼¥à

2D¤ª¤Ï¤¸¤­¥²¡¼¥à(ȯŸÊÔ)

2D¶¯À©²£¥¹¥¯¥í¡¼¥ë¥¢¥¯¥·¥ç¥ó(ȯŸÊÔ)

2D¥¿¥Ã¥×¥·¥å¡¼¥Æ¥£¥ó¥°(³ÈÄ¥ÊÔ)

¥ì¡¼¥¹¥²¡¼¥à(È´¿è)

2DÊüÃÖ¥²¡¼¥à(ȯŸÊÔ)

3D¥ì¡¼¥ë¥¬¥ó¥·¥å¡¼¥Æ¥£¥ó¥°(±þÍÑÊÔ)

3Dæ½Ð¥²¡¼¥à(È´¿è)

2D¥ê¥¢¥ë¥¿¥¤¥à¥¹¥È¥é¥Æ¥¸¡¼

3D¥¿¥Ã¥×¥¢¥¯¥·¥ç¥ó(NavMeshAgent »ÈÍÑ)

2D¥È¥Ã¥×¥Ó¥å¡¼¥¢¥¯¥·¥ç¥ó(¥«¥¨¥ë¤Î°Ù¤Ë¡Á¡¢¥Ü¥³¥¹¥«¥¦¥©¡¼¥ºÉ÷)

VideoPlayer ¥¤¥Ù¥ó¥ÈϢư¤Î¼ÂÁõÎã

VideoPlayer ¥ê¥¹¥ÈÆ⤫¤é¥à¡¼¥Ó¡¼ºÆÀ¸¤Î¼ÂÁõÎã(ȯŸ)

AR ²èÁüÉÕ¤­¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À®¤Î¼ÂÁõÎã

AR ¥ê¥¹¥ÈÆ⤫¤éÀ¸À®¤Î¼ÂÁõÎã(ȯŸ)

2D¥È¥Ã¥×¥Ó¥å¡¼¥¢¥¯¥·¥ç¥ó(¥µ¥Ð¥¤¥Ð¡¼É÷)

private



¤³¤Î¥µ¥¤¥ÈÆâ¤ÎºîÉʤϥæ¥Ë¥Æ¥£¤Á¤ã¤ó¥é¥¤¥»¥ó¥¹¾ò¹à¤Î¸µ¤ËÄ󶡤µ¤ì¤Æ¤¤¤Þ¤¹¡£

´ÉÍý¿Í/Éû´ÉÍý¿Í¤Î¤ßÊÔ½¸¤Ç¤­¤Þ¤¹