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

¡¡¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤ÇÁªÂò¤·¤Æ¤¤¤ë¥­¥ã¥é¤ò¥¿¥¤¥ë¥Þ¥Ã¥×¤ËÇÛÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
£²²ó¤Ëʬ¤±¤Æ¼ÂÁõ¤ò¹Ô¤Ã¤Æ¤¤¤­¤Þ¤¹¡£

¡¡¤³¤Î¼ê½ç¤Ç¤Ï¡¢¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤Ë³Æ¥­¥ã¥é¤Î¥Ü¥¿¥ó¤òÀ¸À®¤·¡¢¥¿¥Ã¥×¤·¤¿¥­¥ã¥é¤òÇÛÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¼¡¤Î¼ê½ç¤Ç¡¢ÁªÂò¤·¤¿¥­¥ã¥é¤Î¥¢¥Ë¥á¤¬Êѹ¹¤µ¤ì¤ë¤è¤¦¤Ë½¤Àµ¤·¤Þ¤¹¡£

¡¡¤è¤Ã¤Æ¡¢¼¡¤Î¼ê½ç¤Þ¤Ç´°À®¤¹¤ë¤³¤È¤Ç¡¢²¼µ­¤ÎÆ°²è¤Î¤è¤¦¤Ë¡¢¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤ÇÁªÂò¤·¤¿¥­¥ã¥é¤¬ÇÛÃÖ¤µ¤ì¤Æ¥¢¥Ë¥á¤¹¤ëµ¡Ç½¤ò¼ÂÁõ¤·¤Þ¤¹¡£


¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯


¡¡°Ê²¼¤ÎÆâÍƤǼÂÁõ¤ò¿Ê¤á¤Æ¤¤¤­¤Þ¤¹¡£

¼ê½ç£²£²¡¡¡¼¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤ÇÁªÂò¤·¤Æ¤¤¤ë¥­¥ã¥é¤ÎÀ¸À®½èÍý¤Î¼ÂÁõ¡¼
£³£¹¡¥PlacementCharaSelectPopUp ¥¹¥¯¥ê¥×¥È¤È CharaGenerator ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢ÁªÂò¤·¤Æ¤¤¤ë¥­¥ã¥é¤ò¥¿¥¤¥ë¥Þ¥Ã¥×¾å¤ËÀ¸À®¤·¤ÆÇÛÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë
£´£°¡¥DataDaseManager ¥¹¥¯¥ê¥×¥È¤È CharaController ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢ÇÛÃÖÍѤËÁªÂò¤·¤¿¥­¥ã¥é¤Î¾ðÊó¤òÀßÄꤹ¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë



¡¡¿·¤·¤¤³Ø½¬ÆâÍƤϡ¢°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£

¡¡¡¦¥¹¥¯¥ê¥×¥È¤Î½¤Àµ¤ËÄ©À魯¤ë
¡¡¡¦¥¹¥¯¥ê¥×¥¿¥Ö¥ë¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Î³èÍÑÊýË¡­¢
¡¡¡¦List.Find ¥á¥½¥Ã¥É
¡¡¡¦¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¿¶¤ëÉñ¤¤¤òÊѤ¨¤ë



£³£¹¡¥PlacementCharaSelectPopUp ¥¹¥¯¥ê¥×¥È¤È CharaGenerator ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢ÁªÂò¤·¤Æ¤¤¤ë¥­¥ã¥é¤ò¥¿¥¤¥ë¥Þ¥Ã¥×¾å¤ËÀ¸À®¤·¤ÆÇÛÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë

£±¡¥Àß·×


¡¡¥­¥ã¥éÁªÂò¤Î¥Ý¥Ã¥×¥¢¥Ã¥×¤Ë¤ª¤¤¤ÆÁªÂò¤·¤¿¥­¥ã¥é¤ò¼ÂºÝ¤Ë¥¿¥¤¥ë¥Þ¥Ã¥×¾å¤ËÇÛÃÖ¤¹¤ë¥í¥¸¥Ã¥¯¤ò¹Í¤¨¤Þ¤¹¡£

¡¡¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤Î¥­¥ã¥é¤Ï¥Ü¥¿¥ó¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ÁªÂò¤·¤¿¥­¥ã¥é¤Î¾ðÊ󤬥ݥåץ¢¥Ã¥×Æâ¤Î chooseCharaData ÊÑ¿ô¤ËÂåÆþ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢¤³¤Î¾ðÊó¤ò¥­¥ã¥é¤òÀ¸À®¤·¤ÆÇÛÃÖ¤¹¤ë¥¯¥é¥¹Â¦¤Ø°ú¿ô¤òÄ̤¸¤ÆÅϤ¹¤³¤È¤¬¤Ç¤­¤ì¤Ð¡¢¥­¥ã¥é¤Î¾ðÊó¤ò¥Ý¥Ã¥×¥¢¥Ã¥×Æ⤫¤éÀ¸À®¥¯¥é¥¹¤Ø¤ÈÆϤ±¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£

¡¡¡¦PlacementCharaSelectPopUp Æâ¤Î  chooseCharaData ÊÑ¿ô¤ËÁªÂòÃæ¤Î¥­¥ã¥é¤Î¾ðÊó(CharaData)¤¬ÂåÆþ¤µ¤ì¤Æ¤¤¤ë
¡¡¡¡¡¡¤³¤Î¾ðÊó¤òÀ¸À®¤¹¤ë¥¯¥é¥¹¤ØÆϤ±¤ë¤³¤È¤¬¤Ç¤­¤ì¤Ð¡¢¤½¤Î¥¯¥é¥¹¤Ç¤â CharaData ¤Î¾ðÊó¤òÍøÍѤ·¤Æ¡¢¥­¥ã¥é¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢­
¡¡¡¦CharaGenerator ¤Ë¿·¤·¤¤¥á¥½¥Ã¥É¤òºîÀ®¤·¡¢°ú¿ô¤Ç CharaData ¤ò¼õ¤±¼è¤ì¤ë¤è¤¦¤Ë¤¹¤ë
¡¡¡¡¡¡¤³¤Î¥á¥½¥Ã¥ÉÆâ¤Ç¥­¥ã¥é¤ÎÀ¸À®¤È¥­¥ã¥é¤Î¾ðÊó¤ÎÀßÄê¤ò¹Ô¤¨¤ë¤è¤¦¤Ë¤¹¤ë

¡¡¤Þ¤º¤Ï¥­¥ã¥é¤ÎÀ¸À®¤Þ¤ÇÅþã¤Ç¤­¤ë¤è¤¦¤Ë¥í¥¸¥Ã¥¯¤ò¹Í¤¨¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£


£²¡¥PlacementCharaSelectPopUp ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤¹¤ë


¡¡»²¹ÍÍѤ˥¹¥¯¥ê¥×¥È¤Î½¤Àµ°Æ¤ò·ÇºÜ¤·¤Æ¤ª¤­¤Þ¤¹¡£

PlacementCharaSelectPopUp.cs


¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤·¤Þ¤¹¡£


£³¡¥CharaGenerator ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤¹¤ë


¡¡»²¹ÍÍѤ˥¹¥¯¥ê¥×¥È¤Î½¤Àµ°Æ¤òÄ󼨤·¤Æ¤ª¤­¤Þ¤¹¡£

CharaGenerator.cs

<= ¥¯¥ê¥Ã¥¯¤¹¤ë¤È³«¤­¤Þ¤¹¡£


¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤·¤Þ¤¹¡£


£´¡¥CharaGenerator ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê¤ò¹Ô¤¦


¡¡¿·¤·¤¯Äɲä·¤¿ CharaCotrollerPrefab ÊÑ¿ô¤Ë Prefabs ¥Õ¥©¥ë¥À¤Ë¤¢¤ë Chara ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥µ¥¤¥ó¤·¤Þ¤¹¡£
¼«Æ°Åª¤Ë CharaCotroller ¥¯¥é¥¹¤Î¾ðÊó¤¬ÂåÆþ¤µ¤ì¤Þ¤¹¡£

¡¡Å¨¤òÀ¸À®¤¹¤ëºÝ¤ÈƱ¤¸¤è¤¦¤Ë¡¢GameObject ·¿¤Ç¤ÎÀë¸À¤Ç¤Ï¤Ê¤¯¡¢CharaController ·¿¤Ç¤ÎÊÑ¿ôÀë¸À¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢¥¤¥ó¥¹¥¿¥ó¥¹¤µ¤ì¤¿¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ðÊó¤Ï CharaController ·¿¤Ç¤¢¤ë¤¿¤á¡¢¤³¤Î¥¯¥é¥¹¤ËÂФ·¤Æ¤Î½èÍý¤ò¤¹¤°¤Ë¼Â¹Ô¤Ç¤­¤ë¾õÂ֤ˤʤäƤ¤¤Þ¤¹¡£
(GameObject ·¿¤Ç¥¤¥ó¥¹¥ó¥¿¥ó¥¹¤·¤¿¾ì¹ç¡¢¥¯¥é¥¹¤Î¾ðÊó¤ò°·¤¦¤Ë¤Ï GetComponent ¥á¥½¥Ã¥É¤¬É¬Íפˤʤê¤Þ¤¹¤¬¡¢¤½¤Î¼ê´Ö¤¬¤¢¤ê¤Þ¤»¤ó)

¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü



£µ¡¥¥²¡¼¥à¤ò¼Â¹Ô¤·¤ÆÆ°ºî¤ò³Îǧ¤¹¤ë


¡¡¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤Ç¥­¥ã¥é¤òÁªÂò¤·¡¢¤½¤Î¥­¥ã¥é¤¬ÇÛÃÖ¤µ¤ì¤ë¤«¤ò³Îǧ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¤¿¤À¤·¤³¤Î»þÅÀ¤Ç¤Ï¡¢¤Þ¤À CharaData ¤Î¾ðÊó¤òÈ¿±Ç¤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢¤¹¤Ù¤ÆƱ¤¸¥­¥ã¥é¤¬ÇÛÃÖ¤µ¤ì¤Þ¤¹¡£


£´£°¡¥DataBaseManager ¥¹¥¯¥ê¥×¥È¤È CharaController ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢ÇÛÃÖÍѤËÁªÂò¤·¤¿¥­¥ã¥é¤Î¾ðÊó¤òÀßÄꤹ¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë

£±¡¥Àß·×


¡¡¥­¥ã¥é¤ÎÀ¸À®¤È CharaData ¤ò¥Ý¥Ã¥×¥¢¥Ã¥×Æ⤫¤é CharaGenerator ¤Þ¤ÇÆϤ±¤ë½èÍý¤¬´°À®¤·¤Þ¤·¤¿¤Î¤Ç¡¢
¤³¤Î¼ê½ç¤Ç¤Ï¡¢CharaController ¤Ë¤ª¤¤¤Æ¡¢CharaData ¤òÍøÍѤ·¤ÆÀßÄê¤ò¹Ô¤¦Éôʬ¤Þ¤Ç¤ò¼ÂÁõ¤·¤Þ¤¹¡£

¡¡¤³¤Î¼ê½ç¤¬½ªÎ»¤¹¤ë¤³¤È¤Ç¡¢ÇÛÃÖ¤µ¤ì¤¿¥­¥ã¥é¤Î¥Ç¡¼¥¿¤¬ CharaData ¤ÎÆâÍƤˤʤê¤Þ¤¹¡£
¤Ä¤Þ¤ê¡¢¥¹¥¯¥ê¥×¥¿¥Ö¥ë¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ÇÀßÄꤷ¤Æ¤¤¤ë¾ðÊ󤬡¢¥²¡¼¥àÆâ¤Ë¤ª¤¤¤Æ³èÍѤµ¤ì¤ë¾õÂ֤ˤʤê¤Þ¤¹¡£

¡¡¤³¤Î¤³¤È¤«¤é¡¢£±¤Ä¤Î Chara ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢¼«Ê¬¤Î¸µ¤ËÆϤ¤¤¿ CharaData ¤ÎÀßÄê¤ò¹Ô¤¦¤³¤È¤Ë¤è¤ê¡¢
¤½¤ÎÅÔÅÙ¡¢°Û¤Ê¤ë¥­¥ã¥é¤È¤·¤Æ¿¶¤ëÉñ¤¤¤òÍ¿¤¨¤é¤¨¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£Æ±¤¸ Chara ¤È¤¤¤¦¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¤Ê¤¬¤é
¸«¤¿ÌܤâǽÎϤâ°Û¤Ê¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬´°À®¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£

¡¡¤³¤ÎÊýË¡¤ò¼ÂÁõ¤¹¤ë¤È¡¢Î㤨¤Ð¥­¥ã¥é¤¬5ÂΤ¤¤ë¾ì¹ç¤Ë¡¢5ÂÎʬ¤Î Chara ¤Î¥×¥ì¥Õ¥¡¥Ö¤òºîÀ®¤¹¤ëɬÍפϤʤ¯¤Ê¤ê¤Þ¤¹¡£
£±¤Ä¤Î Chara ¤Î¥×¥ì¥Õ¥¡¥Ö¤È CharaData ¤Î¥Ç¡¼¥¿¤¬¤¢¤ì¤Ð¡¢CharaData ¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¿·¤·¤¤¥­¥ã¥é¤òºî¤ê½Ð¤¹¤³¤È¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£

¡¡¥×¥í¥°¥é¥à¤Ï¤³¤Î¤è¤¦¤Ë¡ÖƱ¤¸¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¤Ê¤¬¤é¿¶¤ëÉñ¤¤¤òÊѤ¨¤ë¡×½èÍý¤¬²Äǽ¤Ç¤¹¡£

¡¡¤µ¤é¤Ë¼¡¤Î¼ê½ç¤Ç¡¢ÇÛÃÖ¤·¤¿¥­¥ã¥é¤Î¥¢¥Ë¥á¤ÎÀßÄê¤ò¹Ô¤Ã¤Æ´°À®¤Ë¤Ê¤ê¤Þ¤¹¡£


£²¡¥DataBaseManager ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤¹¤ë


¡¡CharaData ¤Ë¤¢¤ë AttackRangeType ¤Î¾ðÊó¤ò³èÍѤǤ­¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¡¢AttackRangeSizeSO ¥¹¥¯¥ê¥×¥¿¥Ö¥ë¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò DataBaseManager ¤Ë¤ª¤¤¤Æ°·¤¨¤ë¾õÂ֤ˤ·¤Þ¤¹¡£

¡¡¤Þ¤¿¡¢AttackRangeType ¤Ë¤è¤Ã¤Æ BoxCollider2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Size ¤òÊѹ¹¤Ç¤­¤ë¤è¤¦¤Ë GetAttackRangeSize ¥á¥½¥Ã¥É¤òºîÀ®¤·¡¢°ú¿ô¤Ç¼õ¤±¼è¤Ã¤¿
AttackRangeType ¤Ë±þ¤¸¤¿ Size ¤Î¾ðÊó¤òÄ󶡤Ǥ­¤ë¤è¤¦¤Ë½àÈ÷¤ò¤·¤Æ¤ª¤­¤Þ¤¹¡£


DataBaseManager.cs

<= ¥¯¥ê¥Ã¥¯¤¹¤ë¤È³«¤­¤Þ¤¹


¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤·¤Þ¤¹¡£


£³¡¥¡ãList.Find¥á¥½¥Ã¥É¡ä


¡¡List¤Ë¤Ï Find ¤È¤¤¤¦¥á¥½¥Ã¥É¤¬¤¢¤ê¤Þ¤¹¡£
List Æâ¤ÎÍ×ÁǤòÀèƬ¤«¤é¸¡º÷¤·¤Æ¡¢»ØÄꤷ¤¿¾ò·ï¤Ë¹çÃפ·¤¿ºÇ½é¤ÎÍ×ÁÇ£±¤Ä¤ò¼è¤ê½Ð¤·¤ÆÌá¤êÃͤȤ·¤ÆÊÖ¤·¤Æ¤¯¤ì¤ë½èÍý¤Ç¤¹¡£
¤³¤ì¤Ï foreach ʸ¤Çµ­½Ò¤¹¤ëÆâÍƤÈƱ¤¸½èÍý¤ò£±¹Ô¤Ç½èÍý¤Ç¤­¤Þ¤¹¡£

  attackRangeSizeSO.attackRangeSizesList.Find(x => x.attackRangeType == attackRangeType).size;


  foreach (AttackRangeSize attackRangeSize in attackRangeSizeSO.attackRangeSizesList) {
      if(attackRangeSize.attackRangeType == attackRangeType) {
          return attackRangeType.size;
      }
  }

¡¡¤³¤Î£²¤Ä¤Î½èÍý¤ÏƱ¤¸ÆâÍƤˤʤê¤Þ¤¹¡£
ºÇ½é¤Ë¹çÃפ·¤¿Ãͤ¬Âоݤˤʤê¤Þ¤¹¤Î¤Ç¡¢¤Þ¤È¤á¤ÆÊ£¿ô¼èÆÀ¤·¤¿¤¤¾ì¹ç¤ä¡¢¹çÃפ¹¤ë¾ò·ï¤òËþ¤¿¤¹Í×ÁǤ¬Ê£¿ô¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¤³¤Î½èÍý¤À¤±¤Ç¤Ï¼ÂÁõ¤Ç¤­¤Þ¤»¤ó¡£


»²¹Í¥µ¥¤¥È
Samurai BlogÍÍ
¡ÚC#ÆþÌç¡ÛList¤ÎÍ×ÁǤò¸¡º÷¤¹¤ëFind¤Î»È¤¤Êý(FindAll/FindIndex)
https://www.sejuku.net/blog/45252


£´¡¥DataBaseManager ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê¤ò¹Ô¤¦


¡¡¿·¤·¤¯Äɲä·¤¿ÊÑ¿ô¤Ë AttackRangeSizeSO ¥¹¥¯¥ê¥×¥¿¥Ö¥ë¡¦¥ª¥Ö¥¸¥§¥¯¥È¤òÅÐÏ¿¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¤Î¤Ç¡¢
Datas ¥Õ¥©¥ë¥À¤Ë¤¢¤ë AttackRangeSizeSO ¥¹¥¯¥ê¥×¥¿¥Ö¥ë¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥µ¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£


DataBaseManager ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü



£µ¡¥CharaController ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤¹¤ë


¡¡CharaData ¤ò³èÍѤ·¤Æ CharaController Æâ¤Ë CharaData ¤Î¾ðÊó¤òÈ¿±Ç¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Î¡¢½é´üÀßÄêÍѤΥ᥽¥Ã¥É¤òºîÀ®¤·¤Þ¤¹¡£
¤³¤Î¥á¥½¥Ã¥É¤Ï public ½¤¾þ»Ò¤ÇÀë¸À¤ò¹Ô¤¤¡¢ CharaGenerator ¤«¤é¸Æ¤Ó½Ð¤·¤ò¤·¤Æ¤â¤é¤Ã¤Æ¡¢¤½¤ÎºÝ¤Ë°ú¿ô¤È¤·¤Æ CharaData ¤Î¾ðÊó¤ò¼õ¤±¼è¤ì¤ëÀ߷פˤ·¤Þ¤¹¡£

¡¡¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢CharaData ¤¬ CharaController ¤Þ¤ÇÆϤ¯¤³¤È¤Ë¤Ê¤ë¤¿¤á¡¢¡¢ÇÛÃÖ¤·¤¿¥­¥ã¥é¤Ë¡¢¤½¤ì¤¾¤ì¤Î¾ðÊó¤òÀßÄꤷ¤ÆÇÛÃÖ¤ò¹Ô¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£

¡¡¹¶·âÈϰϤξðÊó¤Ç¤¢¤ë BoxCollider2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Size ¤Ë¤Ä¤¤¤Æ¤Ï¡¢Àè¤Û¤É DataBaseManager Æâ¤Ë¿·¤·¤¯Äɲä·¤¿ GetAttackRangeSize ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Æ
CharaData ¤Ë¤¢¤ë AttackRangeType ¤Ë¹ç¤ï¤»¤¿ Size ¤ËÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡£¤³¤Î½èÍý¤Ë¤è¤Ã¤Æ¡¢¥­¥ã¥é¤Î¹¶·âÈϰϤòưŪ¤ËÊѤ¨¤ë¤³¤È¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£


CharaController.cs


¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤ò¹Ô¤¤¤Þ¤¹¡£


£¶¡¥Chara ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê¤ò¹Ô¤¦


¡¡Chara ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥ì¥Õ¥¡¥Ö¤òÁªÂò¤·¤Æ¡¢¿·¤·¤¯Àë¸À¤·¤¿ÊÑ¿ô¤Ë¾ðÊó¤ò¥¢¥µ¥¤¥ó¤·¤Þ¤¹¡£

¡¡AttackRangeArea ÊÑ¿ô¤Ë¤ÏƱ̾¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤½¤Á¤é¤ò¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥µ¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£
¤³¤Î BoxCollider2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Size ¤Î¾ðÊó¤ò¡¢CharaData ¤Î¾ðÊó¤Ë´ð¤Å¤¤¤ÆÀ©¸æ¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£

¡¡CharaData ÊÑ¿ô¤Ï¶õ¤Î¤Þ¤Þ¤ÇÌäÂꤢ¤ê¤Þ¤»¤ó¡£½èÍý¤¬À®¸ù¤¹¤ì¤Ð¡¢¤³¤³¤Ë CharaGenerator ¤«¤é CharaData ¤Î¾ðÊó¤¬ÆϤ­¤Þ¤¹¡£
¤½¤ì¤¬¡¢¥¤¥ó¥¹¥¿¥ó¥¹¤µ¤ì¤¿¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Îº£²ó¤Î CharaData ¤Ë¤Ê¤ê¤Þ¤¹¡£


Chara ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü



¡¡°Ê¾å¤ÇÀßÄê¤â´°Î»¤Ç¤¹¡£


£·¡¥¥²¡¼¥à¤ò¼Â¹Ô¤·¤ÆÆ°ºî¤ò³Îǧ¤¹¤ë


¡¡CharaController Æâ¤Ë SetUpChara ¥á¥½¥Ã¥É¤¬Äɲ䵤ì¤Þ¤·¤¿¤Î¤Ç¡¢CharaGenerator ¤Î¥³¥á¥ó¥È¥¢¥¦¥È¤·¤Æ¤¤¤¿Éôʬ¤Î¥³¥á¥ó¥È¥¢¥¦¥È¤òºï½ü¤·¤Æ¸Æ¤Ó½Ð¤·Ì¿Îá¤ò¼ÂÁõ¤·¤Æ¤¯¤À¤µ¤¤¡£

CharaGenerator.cs
        // ¥­¥ã¥é¤ÎÀßÄê
        chara.SetUpChara(charaData, gameManager);

¡¡Àè¤Û¤É¤ÈƱ¤¸¤è¤¦¤Ë¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤Ç¥­¥ã¥é¤òÁªÂò¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
CharaData ¤ÎÃͤ¬¡¢¤½¤ì¤¾¤ì¤Î¥­¥ã¥é¤Î¾ðÊó¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤ÐÀ©¸æÀ®¸ù¤Ç¤¹¡£
¤½¤Î¤¿¤á¡¢ÇÛÃÖ¤µ¤ì¤¿¥­¥ã¥é¤Î²èÁü¤¬¤½¤ì¤¾¤ì¤Ë°Û¤Ê¤Ã¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£

¡¡¤³¤Îµ¡Ç½¤¬¿¶¤ëÉñ¤¤¤òÊѤ¨¤ë¤È¤¤¤¦½èÍý¤Ë¤Ê¤ê¤Þ¤¹¡£

¡¡ÇÛÃÖ¤·¤¿¥­¥ã¥é¤ò¥Ò¥¨¥é¥ë¥­¡¼¤ÇÁªÂò¤·¤Æ¡¢CharaData ¤Î¾ðÊ󤬤½¤ì¤¾¤ì°Û¤Ê¤Ã¤Æ¤¤¤ë¤«¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£

¡¡¤Ê¤ª¡¢¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¾å¤Ç Chara ¤Î³Îǧ¤ò¤·¤¿ºÝ¤Ë¡¢Chara ¤Î²èÁü¤Î¾ðÊó¤¬ CharaData ¤ÎÆâÍƤËÀµ¾ï¤Ë½ñ¤­´¹¤ï¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ç¡¢¥²¡¼¥à²èÌ̤ËÈ¿±Ç¤µ¤ì¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢
Chara ¥×¥ì¥Õ¥¡¥Ö¤Î Animator ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î¥¹¥¤¥Ã¥Á¤ò°ìÅÙ³°¤·¤Æ¤«¤é¡¢¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£

¡¡¤¿¤À¤·¡¢¼¡¤Î¼ê½ç¤Ç Animator ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤òÍøÍѤ·¤Þ¤¹¤Î¤Ç¡¢³Îǧ¤¬½ª¤ï¤Ã¤¿¤é¡¢ºÆÅÙ¡¢¥¹¥¤¥Ã¥Á¤òÆþ¤ì¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£

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

¡¡¼¡¤Ï¡¡¼ê½ç£²£³¡¡¡ÝÇÛÃÖ¤·¤¿¥­¥ã¥é¤Î¥¢¥Ë¥á¤ò¼«Æ°ÀßÄꤹ¤ë½èÍý¤Î¼ÂÁõ¡Ý¡¡¤Ç¤¹¡£

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


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

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

Menu


´ðÁÃ

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

private



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

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