ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2023ǯ09·î15Æü(¶â) 11:22:28ÍúÎò
¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¼ê½ç£±£¶¡¡¡Ý¥é¥ó¥À¥à¥¨¥ó¥«¥¦¥ó¥È¸å¤Î¥·¡¼¥óÁ«°Ü¤Î¼ÂÁõ¡Ý
£²£·¡¥Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤¹¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë £²£¸¡¥Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤·¡¢¥¨¥ó¥«¥¦¥ó¥È¤·¤¿°ÌÃ֤˥ץ쥤¥ä¡¼¥¥ã¥é¤òÀßÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë
¡¡¿·¤·¤¤³Ø½¬ÆâÍƤϡ¢°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
¡¡¡¦Button.onClick.AddListener¥á¥½¥Ã¥É ¡¡¡¦Canvas Æâ¤Ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò¼«Ê¬¤Ç¹Í¤¨¤ÆÇÛÃÖ¤¹¤ë
¡¡Ìµ»ö¤ËÁ«°Ü¤¬¤Ç¤¤Þ¤·¤¿¤Î¤Ç¡¢¼¡¤Ï¡¢Battle ¥·¡¼¥ó¤Ë¥Ü¥¿¥ó¤òÀßÃÖ¤·¡¢¤³¤Î¥Ü¥¿¥ó¤ò²¡¤¹¤È Main ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¡¡¥·¡¼¥ó¤ÏÆɤ߹þ¤Þ¤ì¤ë¤¿¤Ó¤ËÇË´þ¤µ¤ì¤Æ¡¢¿·¤·¤¤¥·¡¼¥ó¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤Ø¤ÎÁ«°Ü¤Ï¡ÖÁ°¤Î Main ¥·¡¼¥ó¤ØÌá¤ë¡×¤È¤¤¤¦½èÍý¤Ç¤Ï¤Ê¤¯¤Æ¡¢¡Ö¿·¤·¤¤ Main ¥·¡¼¥ó¤ØÁ«°Ü¤¹¤ë¡×¤È¤¤¤¦½èÍý¤Ë¤Ê¤ê¤Þ¤¹¡£
¤è¤Ã¤Æ¡¢¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Ï½é´ü°ÌÃÖ¤«¤é¥¹¥¿¡¼¥È¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢¤½¤ì¤Ç¤Ï¥¨¥ó¥«¥¦¥ó¥È¤Î¤¿¤Ó¤Ë¥¹¥¿¡¼¥ÈÃÏÅÀ¤ØÌᤵ¤ì¤Æ¤·¤Þ¤Ã¤Æ¡¢
¥²¡¼¥à¤È¤·¤Æ¤ÏÀ®¤êΩ¤¿¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
¡¡¤Þ¤º¤ÏºÇ½é¤Ë¡¢Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤ØºÆÅÙÁ«°Ü¤¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¤½¤Î½èÍý¤¬¼ÂÁõ¤Ç¤¤¿¤é¡¢Main ¥·¡¼¥óÆâ¤Ë¤¢¤ë¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃÖ¤ÈÊý¸þ¤ò¥¨¥ó¥«¥¦¥ó¥È»þ¤Î¾ðÊó¤òÈ¿±Ç¤¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¡¡²¿ÅÙ¤â½ñ¤¤¤Æ¤¤¤Þ¤¹¤¬¡¢°ìÅ٤ˤ¹¤Ù¤Æ¤Î½èÍý¤ò¼ÂÁõ¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
ÌÜɸ¤È¤Ê¤ë½èÍý¤ÈÌܻؤ·¤Æ¡¢£±¤Ä¤º¤Ä¡¢¤³¤Ä¤³¤Ä¤È¼ÂÁõ¤òÀѤ߽Ťͤƺî¤Ã¤Æ¤¤¤¯¤³¤È¤¬µá¤á¤é¤ì¤Þ¤¹¡£
¡¡Battle ¥·¡¼¥ó¤Î¥Ò¥¨¥é¥ë¥¡¼¤Î¶õ¤¤¤Æ¤¤¤ë¾ì½ê¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤ò³«¤¡¢UI => Canvas ¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£
Canvas ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ºîÀ®¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢¤³¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ Button ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò»ý¤Ä¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¤Æ¤¯¤À¤µ¤¤¡£
¥Ü¥¿¥ó¤Ê¤É¤Î UI µ¡Ç½¤Ï Canvas ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤ËºîÀ®¤·¤Ê¤¤¤Èµ¡Ç½¤·¤Þ¤»¤ó¤Î¤ÇÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡¤³¤Î¥Ü¥¿¥ó¤¬¥Ð¥È¥ë½ªÎ»¤Î²¾½èÍý¤ò¹Ô¤¦¥Ü¥¿¥ó¤Ë¤Ê¤ê¡¢²¡²¼¤¹¤ë¤³¤È¤Ç Battle ¥·¡¼¥ó¤ò½ªÎ»¤·¤Æ¡¢Main ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤¹¤ë½èÍý¤ò¼Â¹Ô¤µ¤»¤Þ¤¹¡£
¡¡ÇÛÃ֤ʤɤϼ«Í³¤Ç¤¹¡£º£¤Þ¤Ç¤Î³Ø½¬¤ò¸µ¤Ë¤·¤Æ¡¢Button ¤òºîÀ®¤·¤ÆÇÛÃÖ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¥Ò¥¨¥é¥ë¥¡¼²èÁü¡¡»²¹Í
Scene ¥Ó¥å¡¼¤ÈGame ¥Ó¥å¡¼²èÁü¡¡»²¹Í
¡¡Battle ¥·¡¼¥ó¤Ç¤Î¥Ü¥¿¥óÁàºî¤ò´ÉÍý¤¹¤ë¤¿¤á¤Î¥¯¥é¥¹¤òºîÀ®¤·¤Þ¤¹¡£
º£¸å Battle ¥·¡¼¥ó¤òºî¤ê¤³¤àºÝ¤Ë¤âÍøÍѤ·¤Æ¤¤¤¿¤À¤¯¤³¤È¤â²Äǽ¤Ç¤¹¡£
¡¡º£²ó¤Ï Button ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤òÀ©¸æ¤¹¤ë¤¿¤á¤Î½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¡¡Button ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Ë¤Ï¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤è¤ê OnClick ¤È¤¤¤¦¥¤¥Ù¥ó¥ÈÉôʬ¤Ë public ½¤¾þ»Ò¤Î¥á¥½¥Ã¥É¤òÅÐÏ¿¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¤¬¡¢
¤³¤Î½èÍý¤Ï¿¤¯¤Î¼ê½ç¤Ç¼ÂÁõ¤·¤Þ¤¹¤Î¤Ç¡¢º£²ó¤Ï¡¢¥¹¥¯¥ê¥×¥È¤ò»È¤Ã¤Æ¤³¤Î OnClick ¥¤¥Ù¥ó¥È¤Ë¥á¥½¥Ã¥É¤òÅÐÏ¿¤¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
BattleManager.cs
¡¡¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤¿¤é¥»¡¼¥Ö¤ò¹Ô¤¤¤Þ¤¹¡£
¡¡Button ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Ë¤Ï OnClick ¤È¤¤¤¦¥¤¥Ù¥ó¥È¤òÅÐÏ¿¤¹¤ë¾ì½ê¤¬¤¢¤ê¤Þ¤¹¡£¤³¤³¤Ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥µ¥¤¥ó¤ò¹Ô¤¦¤³¤È¤Ç¡¢
¥¢¥µ¥¤¥ó¤·¤¿¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¥¹¥¯¥ê¥×¥È¤ËÀë¸À¤µ¤ì¤Æ¤¤¤ë public ½¤¾þ»Ò¤Î¥á¥½¥Ã¥É¤òÅÐÏ¿¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡¤³¤Î½èÍý¤ò¥¹¥¯¥ê¥×¥È¤«¤éÀ©¸æ¤·¤ÆÄɲ䷤ƹԤ¦½èÍý¤¬¡¢onClick.AddListener¥á¥½¥Ã¥É¤Ç¤¹¡£°ú¿ô¤Î¤Ê¤¤¾ì¹ç¤È°ú¿ô¤Î¤¢¤ë¾ì¹ç¤Ç½ñ¼°¤¬ÊѲ½¤·¤Þ¤¹¡£
¡¡ÍøÅÀ¤Ï¡¢private ½¤¾þ»Ò¤Î¥á¥½¥Ã¥É¤Ç¤âÅÐÏ¿¤Ç¤¤ë¤³¤È¡¢¥¹¥¯¥ê¥×¥È¤«¤éÅÐÏ¿¤·¤Æ¤¤¤ë¤Î¤Ç¡¢UnityÆâ¤Î¾åµ¤Î²èÁü¤ÎButtonÉôʬ¤Ø¤ÎÅÐÏ¿ºî¶È¤ä¡¢³Îǧ¤ò¤¹¤ëɬÍפ¬¤Ê¤¯¤Ê¤ë¤³¤È¡¢¤Ê¤É¤¬¤¢¤ê¤Þ¤¹¡£
¡¡º£²ó¤Ï°ú¿ô¤Î¤Ê¤¤¥á¥½¥Ã¥É¤òÅÐÏ¿¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢°ú¿ô¤Ë¤Ï¤½¤Î¤Þ¤Þ¥á¥½¥Ã¥É̾¤òµ½Ò¤·¤Þ¤¹¡£¥á¥½¥Ã¥É¤Î()¤ò½ñ¤¯¤È¥¨¥é¡¼¤Ë¤Ê¤ë¤Î¤Ç¡¢¥á¥½¥Ã¥É̾¤Î¤ß¤òµ½Ò¤·¤Þ¤¹¡£
¡¡// ¥Ü¥¿¥ó¤ÎOnClick¥¤¥Ù¥ó¥È¤Ë OnClickBattleEnd ¥á¥½¥Ã¥É¤òÄɲä¹¤ë ¡¡btnBattleEnd.onClick.AddListener(OnClickBattleEnd);¡¡
¡¡¥³¥á¥ó¥È¤Ë¤â¤¢¤ë¤è¤¦¤Ë¡¢¤³¤Î½èÍý¤Ï¥Ü¥¿¥ó¤Ë¥á¥½¥Ã¥É¤òÅÐÏ¿¤¹¤ë¤À¤±¤Ç¤¹¤Î¤Ç¡¢¥á¥½¥Ã¥É¼«ÂΤμ¹ԽèÍý¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
ÂоݤȤʤë¥Ü¥¿¥ó¤ò²¡¤·¤¿¤È¤¤Ë¼Â¹Ô¤µ¤ì¤ë¥á¥½¥Ã¥É¤òÅÐÏ¿¤·¤Æ¤¤¤ë½èÍý¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¸ø¼°¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¤ò»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£¤Þ¤¿¥Í¥Ã¥È¤Ë¤Ïµ»ö¤¬Â¿¤¯¤¢¤ê¤Þ¤¹¤Î¤ÇÄ´¤Ù¤Æ¤ß¤Þ¤·¤ç¤¦¡£
»²¹Í¥µ¥¤¥È
Unity¸ø¼°¥¹¥¯¥ê¥×¥È¥ê¥Õ¥¡¥ì¥ó¥¹
Button.on.Click.AddListener
https://docs.unity3d.com/ja/2018.4/ScriptReference...
¡¡BattleManager ¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤¹¤ë¤¿¤á¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¤Þ¤¹¡£
¡¡¥Ò¥¨¥é¥ë¥¡¼¤Î¶õ¤¤¤Æ¤¤¤ë¾ì½ê¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤ò³«¤¡¢Create Empty ¤òÁªÂò¤·¤Þ¤¹¡£
¿·¤·¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ºîÀ®¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢Ì¾Á°¤ò BattleManager ¤ËÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡¤½¤Î¸å¡¢BattleManager ¥¹¥¯¥ê¥×¥È¤ò BattleManager ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥¿¥Ã¥Á¤·¤Æ¤¯¤À¤µ¤¤¡£
¥¢¥¿¥Ã¥Á¤·¤¿¤éɬ¤º¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ò¸«¤Æ¡¢¥¢¥¿¥Ã¥Á¤¬Àµ¾ï¤Ë¹Ô¤¨¤Æ¤¤¤ë¤«¤ò³Îǧ¤·¤Þ¤¹¡£
¡¡BattleManager ¥¹¥¯¥ê¥×¥È¤Ë¤Ï btnBattleEnd ÊÑ¿ô¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¤³¤Á¤é¤ËÀ©¸æ¤·¤¿¤¤ Button ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò
¥Ò¥¨¥é¥ë¥¡¼¤è¤ê¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥µ¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£¼«Æ°Åª¤Ë¤½¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Ë¤¢¤ë Button ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î¾ðÊó¤¬ÅÐÏ¿¤µ¤ì¤Þ¤¹¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡°Ê¾å¤Ç¤³¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê¤Ï´°Î»¤Ç¤¹¡£
¡¡Main ¥·¡¼¥ó¤«¤é¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ¡¢¥¨¥ó¥«¥¦¥ó¥È¤·¤Æ Battle ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡Battle ¥·¡¼¥ó¤ËÁ«°Ü¤·¤¿¤é¡¢¥Ð¥È¥ë½ªÎ»ÍѤΥܥ¿¥ó¤ò²¡¤·¤Æ¤¯¤À¤µ¤¤¡£
ºÆÅÙ Main ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤¬È¯À¸¤¹¤ì¤ÐÀ©¸æÀ®¸ù¤Ç¤¹¡£
¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡Main ¥·¡¼¥ó¤ËºÆÅÙ¥·¡¼¥óÁ«°Ü¤·¤¿¤È¤¡¢¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Ï¥¨¥ó¥«¥¦¥ó¥È¤¬È¯À¸¤·¤¿°ÌÃ֤ǤϤʤ¯¡¢¥¹¥¿¡¼¥ÈÃÏÅÀ¤ËÇÛÃÖ¤µ¤ì¤Þ¤¹¡£
¤³¤ì¤Ï°ÊÁ°¤Î Main ¥·¡¼¥ó¤ËÌá¤Ã¤Æ¤¤¤ë¤Î¤Ç¤Ï¤Ê¤¯¡¢¿·¤·¤¤ Main ¥·¡¼¥ó¤òÆɤ߹þ¤ó¤Ç¤¤¤ë¤¿¤á¤Ç¤¹¡£
¡¡ºÇ¸å¤Ë Main ¥·¡¼¥ó¤ØÁ«°Ü¤·¤¿ºÝ¤Ë¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤¬¥¨¥ó¥«¥¦¥ó¥È¤·¤¿°ÌÃÖ¤ÈÊý¸þ¤ËÇÛÃÖ¤µ¤ì¤ë¤è¤¦¤ËÀ©¸æ¤ò¹Ô¤¤¤Þ¤¹¡£
£²£¸¡¥Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤·¡¢¥¨¥ó¥«¥¦¥ó¥È¤·¤¿°ÌÃ֤˥ץ쥤¥ä¡¼¥¥ã¥é¤òÀßÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë
¡¡Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤Ø¤ÎÁ«°Ü½èÍý¤â¼ÂÁõ¤Ç¤¤Þ¤·¤¿¡£
ºÇ¸å¤Ë Main ¥·¡¼¥ó¤ØÁ«°Ü¤·¤¿ºÝ¤Ë¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃÖ¤ÈÊý¸þ¤ò¡¢¥¨¥ó¥«¥¦¥ó¥È»þ¤Î¾õÂÖ¤ËÀßÄꤹ¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¡¡¤¹¤Ù¤Æ¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥·¡¼¥ó¤ÎÁ«°Ü¤È¤È¤â¤ËÇË´þ¤µ¤ì¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¥¹¥¯¥ê¥×¥ÈÆâ¤ÎÊÑ¿ô¤Ê¤É¤Î¾ðÊó¤â¼º¤ï¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
¡¡¤¿¤À¤·¡¢DontDestroyOnLoad ¥á¥½¥Ã¥É¤Ë¤Æ°ú¿ô¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢¥·¡¼¥ó¤ÎÁ«°Ü¤Ë¤è¤Ã¤Æ¤âÇË´þ¤µ¤ì¤Ê¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ê¤ê¤Þ¤¹¡£
¤³¤Îµ¡Ç½¤òÍøÍѤ·¤Æ¡¢¥·¥ó¥°¥ë¥È¥ó¥¯¥é¥¹¤Ç¤¢¤ë GameData ¥¯¥é¥¹¤Ë Main ¥·¡¼¥ó¤Ç¥¨¥ó¥«¥¦¥ó¥È¤·¤¿¤È¤¤Î¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃÖ¾ðÊó¤È¸þ¤¾ðÊó¤òÊÝ»ý¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¶ñÂÎŪ¤Ë¤Ï¡¢EncountManager ¥¯¥é¥¹Æâ¤Î¥¨¥ó¥«¥¦¥ó¥È½èÍý¤ÎÃæ¤Ë¡¢¤³¤ÎÊÝ»ý¤Î½èÍý¤òÄɲä·¤Þ¤¹¡£TODO µ¡Ç½¤¬ÌòΩ¤Ä¤Ç¤·¤ç¤¦¡£
¡¡GameData ¥¯¥é¥¹¤Ï DontDestroyOnLoad ¥á¥½¥Ã¥É¤¬Í¸ú¤Ç¤¢¤ë¤¿¤á¡¢¥·¡¼¥óÁ«°Ü¤ò¹Ô¤Ã¤Æ¤âÇ˲õ¤µ¤ì¤Ê¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¹¡£
¤³¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë GameData ¥¯¥é¥¹Æâ¤Ë Main ¥·¡¼¥ó¤Ç¤Î¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î¾ðÊó¤òÊÝ»ý¤·¤Æ¤ª¤±¤ì¤Ð¡¢
¤½¤Î¾ðÊó¤ò»È¤Ã¤Æ¡¢¿·¤·¤¤ Main ¥·¡¼¥ó¤òÆɤ߹þ¤ó¤ÀºÝ¤Ë¡¢GameData ¥¯¥é¥¹¤ËÊÝ»ý¤·¤Æ¤¤¤ë¥¨¥ó¥«¥¦¥ó¥È¤·¤¿°ÌÃÖ¤ÈÊý¸þ¤Î¾ðÊó¤ò»È¤¦¤³¤È¤Ç¡¢
°ÊÁ°¤Î Main ¥·¡¼¥óÆâ¤Î¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃÖ¤ÈÊý¸þ¤òºÆ¸½¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃÖ¤ÈÊý¸þ¤Î¾ðÊó¤ÎÀßÄê¤Ë¤Ä¤¤¤Æ¤Ï PlayerController ¥¯¥é¥¹¤Ë½èÍý¤ò¼ÂÁõ¤¹¤ë¤³¤È¤Ç¡¢°ÌÃÖ¤ÈÊý¸þ¤ò½¤Àµ¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡½èÍý¤Îή¤ì¤ò¤Þ¤È¤á¤Æ¤ß¤Þ¤·¤ç¤¦¡£
¡¡£±¡¥EncountManager ¥¯¥é¥¹¤Î JudgeRandomEncount ¥á¥½¥Ã¥ÉÆâ¤Ë¤ª¤¤¤Æ¥¨¥ó¥«¥¦¥ó¥È¤¬È¯À¸¤¹¤ë ¡¡£²¡¥¤³¤Î¥á¥½¥Ã¥ÉÆâ¤Ç GameData ¥¯¥é¥¹¤Ë¿·¤·¤¯ÍÑ°Õ¤¹¤ë¥á¥½¥Ã¥É¤ò¼Â¹Ô¤¹¤ë½èÍý¤òÄɲ䷤ơ¢¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò°ú¿ô¤ÇÅϤ¹ ¡¡£³¡¥GameData ¥¯¥é¥¹Æâ¤Ë¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤¬ÆϤ¯¤Î¤Ç¡¢¤½¤ì¤ò¿·¤·¤¯ÍÑ°Õ¤¹¤ëÊÑ¿ô¤ËÂåÆþ¤¹¤ë ¡¡¡¡¡¡¡¡GameData ¥¯¥é¥¹¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë GameData ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥·¡¼¥óÁ«°Ü¤·¤Æ¤âÇË´þ¤µ¤ì¤Ê¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ê¤Î¤Ç¡¢¤³¤ì¤éÊÑ¿ô¤Ï¥·¡¼¥óÁ«°Ü¤·¤Æ¤âÊÝ»ý¤µ¤ì¤ë¾ðÊó¤Ë¤Ê¤ë ¡¡£´¡¥Battle ¥·¡¼¥ó¤ØÁ«°Ü¤¹¤ë ¡¡£µ¡¥Battle ¥·¡¼¥ó¤«¤éºÆÅÙ Main ¥·¡¼¥ó¤ØÁ«°Ü¤¹¤ë¡£¤³¤Î Main ¥·¡¼¥ó¤Ï¿·¤·¤¤ Main ¥·¡¼¥ó¤Ê¤Î¤Ç¡¢¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃÖ¤äÊý¸þ¤Ï½é´ü°ÌÃÖ¤Ë¤Ê¤ë ¡¡£¶¡¥PlayerController ¥¯¥é¥¹¤Î Start ¥á¥½¥Ã¥É¤Ë¿·¤·¤¯½èÍý¤òÄɲä·¡¢¤â¤·¤â Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤ËÁ«°Ü¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤ê¡¢¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò ¡¡¡¡¡¡¡¡GameData ¥¯¥é¥¹¤ËÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò»²¾È¤·¤Æ¡¢ÇÛÃÖ¤òÊѹ¹¤¹¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë
¡¡°Ê¾å¤Î¤è¤¦¤Ê½èÍý¤Îή¤ì¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¤³¤Î½èÍý¤ò½çÈ֤˼ÂÁõ¤·¤Æ¤¤¤¯¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢½èÍý¤ò¼ÂÁõ¤¹¤ë½çÈ֤ȡ¢¼ÂºÝ¤Ë¹Ô¤ï¤ì¤ë½èÍý¤Î½çÈÖ¤ÏÁ°¸å¤·¤Æ¹½¤¤¤Þ¤»¤ó¡£
¡ÊµÕÀâŪ¤Ë¹Í¤¨¤ë¤È¡¢¤³¤Î½çÈ֤ˤȤé¤ï¤ì¤Æ¤·¤Þ¤¦¤È¥¹¥¯¥ê¥×¥È¤Î½¤Àµ¤¬Æñ¤·¤¯¤Ê¤ê¤Þ¤¹¡£¡Ë
¡¡¤Ä¤Þ¤ê¡¢¾åµ¤Î£±¡Á£¶¤Î½èÍý¤ò¼ÂÁõ¤¹¤ë¤Ë¤¢¤¿¤Ã¤Æ¡¢£±¤«¤é½çÈ֤˼ÂÁõ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡¢¤È¤¤¤¦¤³¤È¤Ï¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
¤½¤·¤Æ¤É¤Á¤é¤«¤È¤¤¤¦¤È¥´¡¼¥ëÃÏÅÀ¤Ç¤¢¤ë£¶¤Î½èÍý¤«¤é¼ÂÁõ¤ò¹Ô¤Ã¤Æ¤¤¤Ã¤¿Êý¤¬½èÍý¤Ï¼ÂÁõ¤·¤ä¤¹¤¤¥±¡¼¥¹¤¬Â¿¤¤¤Ç¤¹¡£
¡¡¤³¤ì¤Ï¿·¤·¤¯Äɲ乤ë½èÍý¤ò¡¢£±¤«¤é½ç¤Ë¼Â¹Ô¤·¤Æ¤¤¤¯¤³¤È¤Ë´Ø·¸¤·¤Æ¤¤¤Þ¤¹¡£
Àè¤Î½èÍý¤ò¸«¤Æ¤¤¤¿¤À¤¯¤È¡¢£¶¤Î½èÍý¤Ë¤Ï¿·¤·¤¯Äɲ乤ë½èÍý¤¬¤¢¤ê¤Þ¤¹¡£
¤Þ¤¿¡¢£²¤Î½èÍý¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¤â GameData ¥¯¥é¥¹¤Ë»öÁ°¤Ë¿·¤·¤¤½èÍý¤ò¼ÂÁõ¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
¡¡¤³¤Î¤è¤¦¤Ë½èÍý¤ÎÁ´ÂΤÎή¤ì¤ò¤¢¤é¤«¤¸¤áÇÄ°®¤·¤ÆÀ߷פ·¤Æ¤ª¤¯¤³¤È¤Ë¤è¤ê¡¢¤É¤¦¤¤¤Ã¤¿½çÈ֤ǥ¹¥¯¥ê¥×¥È¤Î½¤Àµ¤ò¤·¤Æ¤¤¤±¤Ð¤è¤¤¤Î¤«¡¢
¤½¤Î¾ðÊó¤ò¼«Ê¬¤Ç´ÉÍý¤¹¤ë¤³¤È¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤ÎÇÄ°®¤ò¤»¤º¤Ë¡¢¤¿¤È¤¨¤Ð£²¤«¤é½èÍý¤ò½ñ¤»Ï¤á¤Æ¤·¤Þ¤Ã¤¿¤È¤·¤Æ¤â
¤³¤³¤Ç½èÍý¤·¤¿¤¤ÆâÍƤ¬ GameData ¥¯¥é¥¹¤Ë¤Ï¤Þ¤À¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¤¿¤á¡¢¼ÂÁõ¤¬¤Ç¤¤Ê¤¤¾õÂ֤ˤʤäƤ·¤Þ¤¤¤Þ¤¹¡£
¡¡¤³¤ì¤¬¼ÂºÝ¤Î½èÍý¤Îή¤ì¤Î½çÈ֤ȡ¢¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤ê¡¢ºîÀ®¤·¤¿¤ê¤¹¤ë½çÈÖ¤¬Á°¸å¤¹¤ë¤È¤¤¤¦°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¾åµ¤Î½èÍý¤Îή¤ì¤ò¤Õ¤Þ¤¨¤Æ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤ò¹Í¤¨¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ê½çÈÖ¤¬¤ä¤ê¤ä¤¹¤¤¤Ç¤·¤ç¤¦¡£
¡¡£±¡¥GameData ¥¯¥é¥¹¤ò½¤Àµ¤·¤Æ¡¢¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë¤¿¤á¤ÎÊÑ¿ô¤ò¿·¤·¤¯ÍÑ°Õ¤¹¤ë¡£ ¡¡¡¡¡¡¡¡¤Þ¤¿¡¢EncountManager ¥¯¥é¥¹¤«¤é¼Â¹Ô¤µ¤ì¤ë¡Ö¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë½èÍý¡×¤òµ½Ò¤·¤¿¥á¥½¥Ã¥É¤òÍÑ°Õ¤¹¤ë ¡¡¡¡¡¡¡¡¤µ¤é¤Ë¡¢PlayerController ¥¯¥é¥¹¤«¤é¼Â¹Ô¤µ¤ì¤ë¡Ö¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò»²¾È¤¹¤ë½èÍý¡×¤òµ½Ò¤·¤¿¥á¥½¥Ã¥É¤òÍÑ°Õ¤¹¤ë ¡¡£²¡¥PlayerController ¥¯¥é¥¹¤ò½¤Àµ¤·¤Æ¡¢GameData ¥¯¥é¥¹¤Î¾ðÊó¤ò»²¾È¤·¤Æ¡¢Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤·¤¿¾ì¹ç¤Ë¸Â¤ê¡¢ ¡¡¡¡¡¡¡¡¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤òÀßÄꤹ¤ë½èÍý¤ò Start ¥á¥½¥Ã¥ÉÆâ¤ËÍÑ°Õ¤¹¤ë¡£ ¡¡¡¡¡¡¡¡Start ¥á¥½¥Ã¥É¤ËÍÑ°Õ¤¹¤ëÍýͳ¤Ï¥²¡¼¥à³«»Ï»þ¤Ë¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤òÀßÄꤷ¤Æ¤ª¤¯É¬Íפ¬¤¢¤ë¤¿¤á ¡¡¡¡¡¡¡¡¤Þ¤¿¡¢¿·¤·¤¯¸þ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò³°Éô¤Î¥¯¥é¥¹¤ÇÍøÍѤǤ¤ë¤è¤¦¤Ë¤¹¤ë¥á¥½¥Ã¥É¤òÍÑ°Õ¤¹¤ë¡£¤Ê¤¼¤Ê¤é¤³¤Î¾ðÊó¤Ï private ½¤¾þ»Ò¤Ç¤¢¤ë¤Î¤Ç¤½¤Î¤Þ¤Þ¤Ç¤Ï³°Éô¤Î¥¯¥é¥¹¤ÇÍøÍѤ¬¤Ç¤¤Ê¤¤¤¿¤á ¡¡£³¡¥EncountManager ¥¯¥é¥¹¤ò½¤Àµ¤·¤Æ¡¢¥¨¥ó¥«¥¦¥ó¥È¤¬È¯À¸¤·¤¿¤È¤¤Ë Battle ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤¹¤ëÁ°¤Ë GameData ¥¯¥é¥¹¤Ë½àÈ÷¤·¤¿ ¡¡¡¡¡¡¡¡¡Ö¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë½èÍý¡×¤ò¹Ô¤¦¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Æ¡¢¤½¤ì¤é¤Î¾ðÊó¤ò GameData ¥¯¥é¥¹¤ËÊÝ»ý¤µ¤»¤ë ¡¡¡¡¡¡¡¡¤³¤Î¤È¤¡¢PlayerController ¥¯¥é¥¹¤ËÍÑ°Õ¤·¤¿¸þ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¥á¥½¥Ã¥É¤âÍøÍѤ·¤ÆÊý¸þ¤Î¾ðÊó¤ò¼èÆÀ¤·¤ÆÍøÍѤ¹¤ë
¡¡Á°²ó¤Î¼ÂÁõ¤Î¤è¤¦¤Ë¡¢¤É¤Á¤é¤Î½çÈ֤ǽñ¤¤¤Æ¤âÊÒÊý¤Î¥¹¥¯¥ê¥×¥È¤Ë°ì»þŪ¤Ë¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¤è¤¦¤Ê¤â¤Î(¶¥¹ç)¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤½¤ì¤òÇÄ°®¤·¤¿¾å¤Ç¤É¤Á¤é¤«¤é½¤Àµ¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£
¡¡
¡¡º£²ó¤Ï¤½¤Î¤è¤¦¤Ë¶¥¹ç¤·¤Æ¤·¤Þ¤¦½èÍý¤Ï¤Ê¤¤¤Î¤Ç¡¢¾åµ¤Î½çÈ֤ǥ¹¥¯¥ê¥×¥È¤Î½¤Àµ¤ò¹Ô¤Ã¤Æ¤¤¤±¤ì¤Ð¡¢À߷פ·¤¿½èÍý¤Îή¤ì¤ò¼ÂÁõ¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡½èÍý¤Îή¤ì¤Ï¤½¤ì¤È¤·¤Æ¡¢¤½¤Îή¤ì¤ò¼ÂÁõ¤·¤Æ¤¤¤¯¤Ë¤Ï¡¢²Ì¤¿¤·¤Æ¤É¤Î¥¹¥¯¥ê¥×¥È¤«¤é¼ÂÁõ¤ò¹Í¤¨¤Æ¤¤¤±¤Ð¤è¤¤¤«¡¢¤½¤Î½çÈÖ¤ÏÊ̤Ȥ·¤Æ¹Í¤¨¤ë¤³¤È¤¬ÂçÀڤǤ¹¡£
¡¡
¡¡¤¹¤Ù¤Æ¤Î¥¹¥¯¥ê¥×¥È¤Ç¤Ï¡¢¤½¤Î¥¹¥¯¥ê¥×¥È¤ËɬÍפʾðÊó¤Ï¤Ê¤ó¤À¤í¤¦¤«¡¢¤È¤¤¤¦ÅÀ¤ò¹Í¤¨¤Æ¤«¤é½¤Àµ¤ò¹Ô¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ξðÊó¤È¸þ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤òÊÝ»ý¤¹¤ë¤¿¤á¤ÎÊÑ¿ô¤È¥á¥½¥Ã¥É¤òºîÀ®¤·¤Þ¤¹¡£
¡¡¥·¥ó¥°¥ë¥È¥ó¥¯¥é¥¹¤Î³Ø½¬¤Î¤¿¤á¡¢GameData ¥¯¥é¥¹¤ò»²¾È¤¹¤ë½èÍý¤Ë¤Ä¤¤¤Æ¤Ï¡¢public ½¤¾þ»Ò¤ÎÊÑ¿ô¤È¡¢private ½¤¾þ»Ò¤ÎÊÑ¿ô¤ÎξÊý¤òÍøÍѤ·¤Æ¤¤¤Þ¤¹¡£
public ½¤¾þ»Ò¤ÎÊÑ¿ô¤ò»²¾È¤¹¤ëºÝ¤Î½ñ¼°¤È¡¢private ½¤¾þ»Ò¤ÎÊÑ¿ô¤ò»²¾È¤¹¤ëºÝ¤Î½ñ¼°¤Î°ã¤¤¤ò¤·¤Ã¤«¤ê¤ÈÍý²ò¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡SetEncountPlayerPosAndDirection ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢°ú¿ô¤ËÆϤ¤¤¿¾ðÊó¤ò GameData ¥¯¥é¥¹Æâ¤ËÍÑ°Õ¤·¤¿ÊÑ¿ô¤ËÊÝ»ý¤·¤Þ¤¹¡£
¡¡Get ¡Á ¤Ç»Ï¤Þ¤ë£²¤Ä¤Î¥á¥½¥Ã¥É¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢¤½¤ì¤¾¤ì¤Î¾ðÊó¤ò¼Â¹Ô¤·¤¿¸Æ¤Ó½Ð¤·¸µ¤Ø¤ÈÌ᤹¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡°ú¿ô¤òÍøÍѤ·¤¿½èÍý¡¢Ìá¤êÃͤò³èÍѤ·¤¿½èÍý¤Ë¤Ä¤¤¤ÆÍý²ò¤ò¿¼¤á¤Æ¤¤¤¤Þ¤·¤ç¤¦¡£
GameData.cs
¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤·¤Þ¤¹¡£
¡¡Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤òÆɤ߹þ¤ó¤ÀºÝ¤Ë¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤ò¥¨¥ó¥«¥¦¥ó¥ÈȯÀ¸»þ¤Î¾õÂÖ¤ËÀßÄꤹ¤ë½èÍý¤òÄɲä·¤Þ¤¹¡£
¤Þ¤¿¡¢¤½¤Î¤¿¤á¤Ë¤Ï¥¥ã¥é¤Î¸þ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò³°Éô¤Î¥¯¥é¥¹¤Ç»²¾È¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹(¤½¤¦¤·¤Ê¤¤¤ÈÊý¸þ¤Î¾ðÊó¤ò³°Éô¥¯¥é¥¹¤ÇÊÝ»ý¤Ç¤¤Ê¤¯¤Ê¤ê¤Þ¤¹)¤Î¤Ç¡¢
ÀìÍѤΥ᥽¥Ã¥É¤òÍÑ°Õ¤·¤Æ¡¢¤½¤Î¥á¥½¥Ã¥É¤ò³°Éô¤Î¥¯¥é¥¹¤Ç¼Â¹Ô¤·¤Æ¤â¤é¤¦¤³¤È¤Ë¤è¤ê¡¢¸þ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò³°Éô¥¯¥é¥¹¤ØÅϤ¹¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡Ãí°Õ¤¹¤ë¤Ù¤ÅÀ¤¬¤¢¤ê¤Þ¤¹¡£
¡¡¤½¤ì¤ÏºÇ½é¤Ë¥²¡¼¥à¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ë¤Ï¥¨¥ó¥«¥¦¥ó¥È¤·¤¿°ÌÃÖ¤ÈÊý¸þ¤Î¾ðÊó¤Ï¤¢¤ê¤Þ¤»¤ó¤Î¤Ç¡¢
¥²¡¼¥à¥¹¥¿¡¼¥È»þ¤Î Main ¥·¡¼¥ó¤Ç¤Ï¡¢¥¹¥¿¡¼¥ÈÃÏÅÀ¤È¤·¤ÆÀßÄꤷ¤Æ¤¤¤ë°ÌÃ֤˥ץ쥤¥ä¡¼¥¥ã¥é¤ÏÀßÃÖ¤µ¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
¡¡¤½¤·¤Æ¡¢¥¨¥ó¥«¥¦¥ó¥È¤·¤¿¸å¤Ë¡¢Battle ¥·¡¼¥ó¤«¤é Main ¥·¡¼¥ó¤Ø¤ÎÁ«°Ü»þ¤Î¤è¤¦¤Ë¡¢
¥¨¥ó¥«¥¦¥ó¥È¤·¤¿°ÌÃÖ¤ÈÊý¸þ¤Î¾ðÊ󤬤¢¤ë¾ì¹ç¤Ë¸Â¤ê¡¢¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤Î°ÌÃÖ¤ÈÊý¸þ¤òÀßÄꤷľ¤¹¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¡¡¤³¤¦¤¤¤Ã¤¿À©¸æ½èÍý¤ò¹Ô¤¦¤Ë¤Ï¤É¤Î¤è¤¦¤Ê½èÍý¤ò¼ÂÁõ¤¹¤ì¤Ð¤è¤¤¤«¡¢¥í¥¸¥Ã¥¯¤ò¤·¤Ã¤«¤ê¤È¹Í¤¨¤Æ¤Ê¤¬¤é½èÍý¤òÆɤ߲ò¤¤¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
PlayerController.cs
¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤ò¤·¤Þ¤¹¡£
¡¡Á°²ó¤ÈƱ¤¸¤è¤¦¤Ë TODO µ¡Ç½¤ÎÉôʬ¤Ë¥×¥ì¥¤¥ä¡¼¤Î°ÌÃÖ¤ÈÊý¸þ¤òÊÝ»ý¤¹¤ë½èÍý¤Î¼ÂÁõ¤ò¹Ô¤¤¤Þ¤¹¡£
¡¡¾ðÊó¤òÊÝ»ý¤µ¤»¤ë¥¹¥¯¥ê¥×¥È¤Ï GameData ¥¯¥é¥¹¤Ë¤Ê¤ê¤Þ¤¹¡£GameData ¥¯¥é¥¹¤ËÀè¤Û¤ÉÍÑ°Õ¤·¤¿¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Æ¡¢
¥×¥ì¥¤¥ä¡¼¤Î°ÌÃ֤ȸþ¤¤¤Æ¤¤¤ëÊý¸þ¤Î¾ðÊó¤ò GameData ¥¯¥é¥¹¤ËÊÝ»ý¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£
¡¡EncountManager ¥¯¥é¥¹¤Ï PlayerController ¥¯¥é¥¹¤òÊÑ¿ô¤ËÂåÆþ¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¼«Í³¤Ë°·¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
°ÌÃÖ¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¡¢PlayerController ¥¯¥é¥¹·Ðͳ¤Ç Transform ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Position ¤òÂоݤȤ·¤Æ¤¯¤À¤µ¤¤¡£
¡¡¸þ¤¤¤Æ¤¤¤ëÊý¸þ¤Ë¤Ä¤¤¤Æ¤Ï PlayerController ¥¯¥é¥¹Æâ¤Ë¤¢¤ë lookDirection ÊÑ¿ô¤¬°·¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¤³¤ÎÊÑ¿ô¤Ï private ¤Ç¤¹¡£¤è¤Ã¤Æ³°Éô¥¯¥é¥¹¤«¤é¤ÏľÀÜ»²¾È¤Ç¤¤Þ¤»¤ó¡£
¤½¤Î¤¿¤áÀè¤Û¤É¡¢PlayerController ¥¯¥é¥¹¤Ë¤³¤Î¾ðÊó¤ò¼èÆÀ¤¹¤ë¤¿¤á¤Î¥á¥½¥Ã¥É¤ò½àÈ÷¤·¤Þ¤·¤¿¤Î¤Ç¡¢¤½¤Î¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Æ¾ðÊó¤ò¼èÆÀ¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡¤Ê¤ªÊÝ»ý¤µ¤»¤ë¾ðÊó¤Ç¤¹¤¬¡¢Position ¤Î Vector2 ·¿¤Ç¤Ï¤Ê¤¯¤Æ Transform ·¿¤Ë¤ÆµÏ¿¤¹¤ë¤È¡¢
Á°¤Î Main ¥·¡¼¥ó¤Î PlayerController ¤ò»²¾È¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤¿¤á¡¢¥·¡¼¥óÁ«°Ü»þ¤Ë Á°¤Î¥·¡¼¥ó¤Î PlayerController ¤¬¤Ê¤¤¤¿¤á¥¨¥é¡¼¤Ç½èÍý¤¬Ää»ß¤·¤Þ¤¹¡£
¡¡¤½¤Î¤¿¤á¡¢ÊÝ»ý¤µ¤»¤ëºÝ¤Ë¤â¡¢¤É¤Î¾ðÊó¤¬Í¸ú¤Ç¡¢¤É¤Î¾ðÊó¤Ï¥¨¥é¡¼¤Ë¤Ê¤ë¤Î¤«¤òÀººº¤·¤ÆÀßÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¡¡¤Þ¤¿½èÍý¤òµ½Ò¤¹¤ë½çÈ֤ˤâÃí°Õ¤òʧ¤Ã¤Æ¤¯¤À¤µ¤¤¡£GameData ¥¯¥é¥¹¤Ë¾ðÊó¤òÊÝ»ý¤µ¤»¤ëÁ°¤Ë¥·¡¼¥óÁ«°Ü¤·¤Æ¤·¤Þ¤¦¤È¡¢
ºÆÅÙ Main ¥·¡¼¥ó¤ËÁ«°Ü¤·¤¿¤È¤¤Ë¡¢GameData ¥¯¥é¥¹¤Ë¾ðÊ󤬤ʤ¤¤¿¤á¡¢¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤òÌ᤹¤Ù¤°ÌÃÖ¤äÊý¸þ¤Î¾ðÊ󤬤ʤ¤¤¿¤á¡¢½èÍý¤ò¼Â¹Ô¤Ç¤¤Þ¤»¤ó¡£
EncountManager.cs
¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤ò¹Ô¤¤¤Þ¤¹¡£
¡¡Main ¥·¡¼¥ó¤Ë¤Æ¥¨¥ó¥«¥¦¥ó¥È¤òȯÀ¸¤µ¤»¤Æ¡¢Battle ¥·¡¼¥ó¤ËÁ«°Ü¤·¤Þ¤¹¡£
Battle ¥·¡¼¥ó¤Ç¥Ð¥È¥ë½ªÎ»ÍѤΥܥ¿¥ó¤ò²¡¤·¤Æ¡¢ºÆÅÙ¡¢Main ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£
¤³¤Î¤È¤¡¢¥¨¥ó¥«¥¦¥ó¥È¤·¤¿°ÌÃÖ¤ÈÊý¸þ¤ò¸þ¤¤¤Æ¥×¥ì¥¤¥ä¡¼¥¥ã¥é¤¬ Main ¥·¡¼¥ó¤ËÇÛÃÖ¤µ¤ì¤ì¤ÐÀ©¸æÀ®¸ù¤Ç¤¹¡£
¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡¤³¤³¤Þ¤ÇÀ½ºî¤·¤Æ¤¤¤¿¤À¤¯¤È¤ï¤«¤ë¤«¤È»×¤¤¤Þ¤¹¤¬¡¢°ì¸«´Êñ¤½¤¦¤Ë¸«¤¨¤ë¥²¡¼¥à²èÌ̾å¤Ç¤ÎÀ©¸æ¤â
ÆâÉôŪ¤Ë¤Ï¤³¤ì¤À¤±¤Î½èÍý¤ò¼ÂÁõ¤·¤Ê¤¤¤È¥²¡¼¥à²èÌ̤ǤÎÀ©¸æ¤¬¹Ô¤¨¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¤½¤Î¤¿¤á¡¢¼«Ê¬¤¬¼ÂÁõ¤·¤¿¤¤¤È»×¤¦¥´¡¼¥ëÃÏÅÀ¤ò·è¤á¤Æ¡¢¤½¤³¤Ë¸þ¤«¤Ã¤Æ¾¯¤·¤º¤Ä¼ÂÁõ¤ò¿Ê¤á¤Æ¤¤¤¯¤³¤È¤¬ÂçÀڤˤʤê¤Þ¤¹¡£
¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£
¡¡¼¡¤Ï¡¡¼ê½ç£±£·¡¡¡Ý¥¢¥¤¥Æ¥àÍѤΥǡ¼¥¿¥Ù¡¼¥¹¤ÎºîÀ®¡Ý¡¡¤Ç¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯