ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2022ǯ01·î15Æü(ÅÚ) 16:18:16ÍúÎò
¡¡¤³¤Îµ¡Ç½¤ò¼ÂÁõ¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¥×¥ì¥¤¥ä¡¼¤Î¼êÈ֤ȥ¨¥Í¥ß¡¼Â¦¤Î¼êÈÖ¤¬¸ò¸ß¤ËÆþ¤ìÂؤï¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
Æþ¤ìÂؤï¤ë¥¿¥¤¥ß¥ó¥°¤Ï°ÜÆ°¸å¤Ç¤¹¡£¥×¥ì¥¤¥ä¡¼¤¬£±¥Þ¥¹°ÜÆ°¤¹¤ë¤È¡¢¥¨¥Í¥ß¡¼Â¦¤Î¼êÈ֤ˤʤꡢ³Æ¥¨¥Í¥ß¡¼¤¬£±¥Þ¥¹¤À¤±°ÜÆ°¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
¤¹¤Ù¤Æ¤Î¥¨¥Í¥ß¡¼¤Î°ÜÆ°¤¬½ªÎ»¤¹¤ë¤È¡¢¥×¥ì¥¤¥ä¡¼¤Î¼êÈÖ¤ËÌá¤ê¤Þ¤¹¡£¤³¤ì¤ò¥µ¥¤¥¯¥ë²½¤·¤Æ¡¢¥²¡¼¥àÆâ¤Ç·«¤êÊÖ¤·½èÍý¤¬¹Ô¤¨¤ë¤è¤¦¤Ê¥í¥¸¥Ã¥¯¤ò¹Í¤¨¤Æ¼ÂÁõ¤·¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡Ê£¿ô¤Î¥¯¥é¥¹¤Ë½èÍý¤¬¤Þ¤¿¤¬¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¢¸Æ¤Ó½Ð¤¹¥á¥½¥Ã¥É¤äÊÑ¿ô¤¬ÍÑ°Õ¤·¤Æ¤¤¤Ê¤¤¤È¡¢¤½¤ÎÉôʬ¤Ë¥¨¥é¡¼¤¬¤Ç¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢£´¤Ä¤Î¥¹¥¯¥ê¥×¥È¤òÁ´Éô½ñ¤½ª¤ï¤ë¤È¾Ã¤¨¤Þ¤¹¡£
SymbolBase¡¡¤Î½¤Àµ¤ò¤·¤Æ¤«¤é¡¢SymbolManager¡¡¢ª¡¡Stage¡¡¢ª¡¡MapMoveController ¤Î½çÈÖ¤¬°ìÈÖ¥¨¥é¡¼¤¬¤Ç¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
¡¡½èÍý¤Î¥í¥¸¥Ã¥¯¤Ï¡¢
£±¡¥Stage ¤Î Start ¥á¥½¥Ã¥É¤«¤é½èÍý¤¬»Ï¤Þ¤ë¤è¤¦¤ËÀßÄꤷ¡¢¤½¤³¤«¤é¡¢StageGenerator ¤ä SymbolManager ¡¢MapMoveController ¤Ë¤½¤ì¤¾¤ìÌ¿Î᤬¤¤¤Ã¤Æ ¥¹¥Æ¡¼¥¸¤Î¥¿¥¤¥ë¤òºî¤ê¡¢¥·¥ó¥Ü¥ë¤òÇÛÃÖ¤·¡¢¥·¥ó¥Ü¥ë¤ä¥×¥ì¥¤¥ä¡¼¤Î½é´üÀßÄê¤ò¤·¤Þ¤¹¡£
¡¡Stage ¥¯¥é¥¹¤Ë¤Ï¡¢¥¿¡¼¥ó´ÉÍýÍѤΠenum ¤ò¿·¤·¤¯ºîÀ®¤·¤Þ¤¹¡£
public enum TurnState { None, Player, Enemy, Boss } private TurnState currentTurnState = TurnState.None;
¡¡currentTurnState ÊÑ¿ô¤¬¡¢¸½ºß¤Î¥¿¡¼¥ó¤Î¿Ê¹Ô¾õÂÖ¤òɽ¤·¤Þ¤¹¡£
£²¡¥¤½¤Î¸å¡¢¥¿¡¼¥ó¤Î¥¹¥Æ¡¼¥È¤¬¥×¥ì¥¤¥ä¡¼¤Ë¤Ê¤Ã¤Æ¡¢¥¡¼ÆþÎϤ¬µö²Ä¤µ¤ì¤Þ¤¹¡£
¡¡¤¤¤Þ¤Þ¤Ç°ÜÆ°¤Ï¼«Í³¤Ë¤Ç¤¤Æ¤¤¤Þ¤·¤¿¤¬¡¢¤½¤ì¤Ï¡¢IsMoveing ÊÑ¿ô¤Ë¤è¤Ã¤ÆÀ©¸æ¤µ¤ì¤Æ¤¤¤Þ¤·¤¿¡£
¤½¤Î¤¿¤á¡¢¤³¤ÎÊÑ¿ô¤¬µö²Ä¤ò½Ð¤µ¤Ê¤¤¸Â¤ê¤Ï¡¢¥×¥ì¥¤¥ä¡¼¤Î¥¡¼ÆþÎϤϼõ¤±ÉÕ¤±¤Ê¤¯¤Ê¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢
¤½¤ì¤òÍøÍѤ·¤Æ¡¢¥¿¡¼¥ó¤òºî¤ê¤Þ¤¹¡£
¡¡¥×¥ì¥¤¥ä¡¼¤¬£±¥Þ¥¹°ÜÆ°¤¹¤ë¤È¡¢°ÜÆ°¸å¤Ë°ÊÁ°¤Ï¤¹¤°¤Ë IsMoveing ÊÑ¿ô¤¬ false ¤Ë¤Ê¤ê¡¢¼¡¤Î¥¡¼ÆþÎϤò¼õ¤±ÉÕ¤±¤Æ¤¤¤¿¤Î¤Ç¡¢
¤Þ¤º¡¢¤³¤ì¤ò¤¹¤°¤Ë false ¤Ë¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡¤³¤ÎÀ©¸æ¤Ë¤è¤ê¡¢¥×¥ì¥¤¥ä¡¼¤Ï¡¢¥¡¼ÆþÎÏ£±²ó¤Ë¤Ä¤°ÜÆ°£±²ó¤È¤¤¤¦À©¸Â¤¬¤«¤«¤ê¤Þ¤¹¡£
¤³¤ì¤ò¥×¥ì¥¤¥ä¡¼¤Î¥¿¡¼¥ó¤È¤·¤Æ¹Í¤¨¤Þ¤¹¡£
£³¡¥MapMoveControoler ¥¯¥é¥¹¤Î DOMove ¥á¥½¥Ã¥É¤Î OnComplete ¥á¥½¥Ã¥ÉÆâ¤Ç¡¢¤¤¤Þ¤Þ¤Ç IsMoving ÊÑ¿ô¤ò false ¤Ë¤·¤Æ¤¤¤¿Éôʬ¤Ç¡¢Âå¤ï¤ê¤Ë¡¢Stage ¥¯¥é¥¹¤Î ObserveEemyTurnState ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£ ¡¡¡¡¤³¤ì¤¬¥¨¥Í¥ß¡¼¤Î¥¿¡¼¥ó¤Î³«»Ï¤Ç¤¹¡£
¡¡¤³¤Î ObserveEemyTurnState ¥á¥½¥Ã¥É¤Ï¥³¥ë¡¼¥Á¥ó¥á¥½¥Ã¥É¤Ê¤Î¤Ç¡¢¥á¥½¥Ã¥ÉÆâ¤Ë¤ª¤¤¤Æ¡¢½èÍý¤ÎÃæÃǤ¬¹Ô¤¨¤Þ¤¹¡£
¤³¤ì¤òÍøÍѤ·¤Æ¡¢SymbolManager ¥¯¥é¥¹¤Î EnemisMove ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤¹¤ëºÝ¡¢¤¹¤Ù¤Æ¤Î¥¨¥Í¥ß¡¼¤Î°ÜÆ°¤¬½ªÎ»¤¹¤ë¤Þ¤Ç¡¢¼¡¤Î½èÍý¤òÃæÃǤ¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹¡£
£´¡¥SymbolManager ¥¯¥é¥¹¤Î EnemisMove ¥á¥½¥Ã¥É¤ò yiled return ÉդΠStartCoroutine ¥á¥½¥Ã¥É¤Ç¼Â¹Ô¤·¡¢¥¨¥Í¥ß¡¼¤Î°ÜÆ°¤ò£±ÂΤº¤Ä¹Ô¤¤¤Þ¤¹¡£ ¡¡¡¡¤³¤Î½èÍý¤Ë¤è¤ê¡¢¤¹¤Ù¤Æ°ÜÆ°¤¬½ª¤ï¤ë¤Þ¤Ç¡¢²¼¤Î½èÍý¤Ë¤Ï¤¤¤«¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢¥¨¥Í¥ß¡¼¤Î°ÜÆ°Ãæ¤Ë¾¤Î½èÍý¤¬Æ°¤¤À¤¹¤³¤È¤òÀ©¸æ¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¥¨¥Í¥ß¡¼¤Î°ÜÆ°´°Î»¸å¡¢¥¨¥Í¥ß¡¼¤Î¥·¥ó¥Ü¥ë¤ËÀÜ¿¨¤·¤Æ¤¤¤¿¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥¿¥¤¥ß¥ó¥°¤Ç¥Ð¥È¥ë¤Ø¤ÎÁ«°Ü¤ò¹Ô¤¤¤Þ¤¹¡£
¤³¤³¤â¤¤¤Þ¤Þ¤Ç¤È°ã¤¦Éôʬ¤Ç¤¹¡£°ÊÁ°¤Ï¡¢¥·¥ó¥Ü¥ë¤Ë¿¯Æþ¤·¤¿½Ö´Ö¤Ë¥Ð¥È¥ë¤ËÁ«°Ü¤·¤Æ¤¤¤Þ¤·¤¿¡£
¡¡¥¨¥Í¥ß¡¼°Ê³°¤Î¥·¥ó¥Ü¥ë¤Ï¡¢¥·¥ó¥Ü¥ë¤Ë¿¯Æþ¤·¤¿ºÝ¤Ë¤¹¤°¤Ë TriggerSymbol ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤³¤ì¤Ïº£¤Þ¤ÇÄ̤ê¤Ç¤¹¡£
¥¨¥Í¥ß¡¼¤Î¾ì¹ç¤Ï¡¢¤¹¤°¤Ë¥Ð¥È¥ë¤Ø¤ÎÁ«°Ü¤ò¹Ô¤Ã¤Æ¤·¤Þ¤¦¤È¡¢Â¾¤Î¥¨¥Í¥ß¡¼¤Î¥·¥ó¥Ü¥ë¤Î°ÜÆ°¤¬´°Î»¤·¤Ê¤«¤Ã¤¿¤ê¡¢
Ê£¿ô¤Î¥¨¥Í¥ß¡¼¤Î¥·¥ó¥Ü¥ë¤È¥¨¥ó¥«¥¦¥ó¥È¤·¤Æ¤·¤Þ¤Ã¤¿¤ê¤È¤¤¤¦ÉÔ¶ñ¹ç¤òÀ¸¤¸¤µ¤»¤Þ¤¹¡£
¡¡¤³¤ì¤òËɤ°¤¿¤á¤Ë¡¢¥¨¥Í¥ß¡¼¤Î¥·¥ó¥Ü¥ë¤Î½èÍý¤Î¤ß¡¢¥¨¥Í¥ß¡¼¤Î°ÜÆ°¤¬´°Î»¤·¤Æ¤«¤é¡¢¥Ð¥È¥ë¤Ø¤ÎÁ«°Ü½èÍý¤ò¼Â¹Ô¤·¤Þ¤¹¡£
¤³¤Îµ¡Ç½¤Ï¡¢UnityEvent ¤È¤¤¤¦µ¡Ç½¤òÍøÍѤ·¤Æ¤¤¤Þ¤¹¡£
MapMoveController 200¹ÔÌÜ // ¥·¥ó¥Ü¥ë¤Î¥¤¥Ù¥ó¥È¤òÅÐÏ¿¤·¤ÆͽÌó¤·¡¢¤¹¤Ù¤Æ¤Î¥¨¥Í¥ß¡¼¤Î°ÜÆ°¤¬½ªÎ»¤·¤Æ¤«¤é¼Â¹Ô enemySymbolTriggerEvent = new UnityEvent<MapMoveController>(); enemySymbolTriggerEvent.AddListener(symbolBase.TriggerSymbol);
¡¡¤³¤Î UnityEvent ¤Îµ¡Ç½¤ò»È¤¦¤³¤È¤Ç¡¢»öÁ°¤Ë¼Â¹Ô¤·¤¿¤¤¥á¥½¥Ã¥É¤òÊÑ¿ô¤ËÅÐÏ¿¤·¤Æ¤ª¤¤¤Æ¡¢
¥¨¥Í¥ß¡¼¤Î°ÜÆ°¸å¤Ë¡¢ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥á¥½¥Ã¥É¤¬¤¢¤ë¾ì¹ç¤Î¤ß¡¢¥¨¥Í¥ß¡¼¤È¤Î¥Ð¥È¥ë¤òȯÀ¸¤µ¤»¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¤½¤Î¤¿¤á¡¢SymbolBase ¥¯¥é¥¹¤Ç TriggerSymbol ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤¿ºÝ¡¢ºÇ¸å¤Ë¥·¥ó¥Ü¥ë¤òÇ˲õ¤¹¤ë DestroySymbol ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Æ¤¤¤Þ¤·¤¿¤¬
¥¨¥Í¥ß¡¼¤È¡¢¥¨¥Í¥ß¡¼°Ê³°¤Î¥·¥ó¥Ü¥ë¤È¤Ç TriggerSymbol ¥á¥½¥Ã¥É¤¬¼Â¹Ô¤µ¤ì¤ë¥¿¥¤¥ß¥ó¥°¤¬°Û¤Ê¤ë¤¿¤á¡¢
TriggerSymbol ¥á¥½¥Ã¥É¤Ç¶¯À©Åª¤Ë DestroySymbol ¥á¥½¥Ã¥É¤Ï¼Â¹Ô¤·¤Ê¤¤¤è¤¦¤Ë½èÍý¤òÊѹ¹¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¾åµ¤Î£´¤Ä¤Î¥¯¥é¥¹¤¬´°À®¤·¤¿¤é¡¢¥¨¥Í¥ß¡¼ÍѤΥ·¥ó¥Ü¥ë¤Î½èÍý¤ò½¤Àµ¤·¤Þ¤¹¡£
¤³¤³¤Ë¤Ï¿·¤·¤¯¡¢¥¨¥Í¥ß¡¼¤ò°ÜÆ°¤µ¤»¤ë½èÍý¤Ê¤É¤¬Äɲ䵤ì¤Æ¤¤¤Þ¤¹¡£
¡¡SymbolManager ¥¯¥é¥¹¤Ë¤Ï¾åµ¤ÎÊÑ¿ô¤òÄɲ䷤ơ¢Grid_Collsion ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤Î TileMap ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¢¥µ¥¤¥ó¤·¤Æ¤¢¤ê¤Þ¤¹¡£
¤³¤ì¤Ï¡¢¥¨¥Í¥ß¡¼¤¬°ÜÆ°¤¹¤ëºÝ¤Ë¡¢¥³¥é¥¤¥À¡¼¤Î¤Ä¤¤¤Æ¤¤¤ë¥¿¥¤¥ë¤Ë¤Ï¿¯Æþ¤Ç¤¤Ê¤¤¤è¤¦¤ËȽÄꤹ¤ë¤¿¤á¤ËÍøÍѤ¹¤ë¤«¤é¤Ç¤¹¡£
Ray ¤¬È½Äê¤Ç¤¤ë¤è¤¦¤Ë¡¢¥¨¥Í¥ß¡¼¤Î¥·¥ó¥Ü¥ë¤Ë¤Ï¿·¤·¤¯ Symbol ¥ì¥¤¥ä¡¼¤òºîÀ®¤·¤Æ¡¢ÀßÄꤷ¤Æ¤ª¤¤Þ¤¹¡£
£µ¡¥¥¨¥Í¥ß¡¼¤È¤Î¥Ð¥È¥ë¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢Stage ¥¯¥é¥¹Æâ¤Î CheckTurn ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Æ¡¢¥¿¡¼¥ó¤òÀÚ¤êÂؤ¨¤Þ¤¹¡£ ¡¡¡¡°ÜÆ°²ó¿ô¤¬¤Î¤³¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢¥Ü¥¹¤È¤Î¥Ð¥È¥ë¤Ë¶¯À©Åª¤Ë¤Ê¤ê¤Þ¤¹¡£ ¡¡¡¡°ÜÆ°²ó¿ô¤¬¤Î¤³¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ºÆÅÙ¡¢¥×¥ì¥¤¥ä¡¼¤Î¥¿¡¼¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£ ¡¡¡¡¥¨¥Í¥ß¡¼¤È¤Î¥Ð¥È¥ë¤¬¤¢¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢OnEnable ¥á¥½¥Ã¥ÉÆâ¤Ç¡¢CheckTurn ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¡¢¥¿¡¼¥ó¤ÎÀÚ¤êÂؤ¨¤ò¹Ô¤¤¤Þ¤¹¡£
¡¡°Ê¾å¤¬¡¢º£²óƳÆþ¤¹¤ë¥¿¡¼¥ó¤Îµ¡Ç½¤Î½èÍý¤Îή¤ì¤Ë¤Ê¤ê¤Þ¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯