ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2022ǯ07·î24Æü(Æü) 14:59:53ÍúÎò
£²²ó¤Ëʬ¤±¤Æ¼ÂÁõ¤ò¹Ô¤Ã¤Æ¤¤¤¤Þ¤¹¡£
¡¡¤³¤Î¼ê½ç¤Ç¤Ï¡¢¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤Ë³Æ¥¥ã¥é¤Î¥Ü¥¿¥ó¤òÀ¸À®¤·¡¢¥¿¥Ã¥×¤·¤¿¥¥ã¥é¤òÇÛÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¼¡¤Î¼ê½ç¤Ç¡¢ÁªÂò¤·¤¿¥¥ã¥é¤Î¥¢¥Ë¥á¤¬Êѹ¹¤µ¤ì¤ë¤è¤¦¤Ë½¤Àµ¤·¤Þ¤¹¡£
¡¡¤è¤Ã¤Æ¡¢¼¡¤Î¼ê½ç¤Þ¤Ç´°À®¤¹¤ë¤³¤È¤Ç¡¢²¼µ¤ÎÆ°²è¤Î¤è¤¦¤Ë¡¢¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤ÇÁªÂò¤·¤¿¥¥ã¥é¤¬ÇÛÃÖ¤µ¤ì¤Æ¥¢¥Ë¥á¤¹¤ëµ¡Ç½¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡°Ê²¼¤ÎÆâÍƤǼÂÁõ¤ò¿Ê¤á¤Æ¤¤¤¤Þ¤¹¡£
¼ê½ç£²£²¡¡¡¼¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤ÇÁªÂò¤·¤Æ¤¤¤ë¥¥ã¥é¤ÎÀ¸À®½èÍý¤Î¼ÂÁõ¡¼
£³£¹¡¥PlacementCharaSelectPopUp ¥¹¥¯¥ê¥×¥È¤È CharaGenerator ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢ÁªÂò¤·¤Æ¤¤¤ë¥¥ã¥é¤ò¥¿¥¤¥ë¥Þ¥Ã¥×¾å¤ËÀ¸À®¤·¤ÆÇÛÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë £´£°¡¥DataDaseManager ¥¹¥¯¥ê¥×¥È¤È CharaController ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢ÇÛÃÖÍѤËÁªÂò¤·¤¿¥¥ã¥é¤Î¾ðÊó¤òÀßÄꤹ¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë
¡¡¿·¤·¤¤³Ø½¬ÆâÍƤϡ¢°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
¡¡¡¦¥¹¥¯¥ê¥×¥È¤Î½¤Àµ¤ËÄ©À魯¤ë ¡¡¡¦¥¹¥¯¥ê¥×¥¿¥Ö¥ë¡¦¥ª¥Ö¥¸¥§¥¯¥È¤Î³èÍÑÊýË¡¢ ¡¡¡¦List.Find ¥á¥½¥Ã¥É ¡¡¡¦¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¿¶¤ëÉñ¤¤¤òÊѤ¨¤ë
£³£¹¡¥PlacementCharaSelectPopUp ¥¹¥¯¥ê¥×¥È¤È CharaGenerator ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¡¢ÁªÂò¤·¤Æ¤¤¤ë¥¥ã¥é¤ò¥¿¥¤¥ë¥Þ¥Ã¥×¾å¤ËÀ¸À®¤·¤ÆÇÛÃÖ¤¹¤ë½èÍý¤ò¼ÂÁõ¤¹¤ë
¡¡¥¥ã¥éÁªÂò¤Î¥Ý¥Ã¥×¥¢¥Ã¥×¤Ë¤ª¤¤¤ÆÁªÂò¤·¤¿¥¥ã¥é¤ò¼ÂºÝ¤Ë¥¿¥¤¥ë¥Þ¥Ã¥×¾å¤ËÇÛÃÖ¤¹¤ë¥í¥¸¥Ã¥¯¤ò¹Í¤¨¤Þ¤¹¡£
¡¡¥Ý¥Ã¥×¥¢¥Ã¥×Æâ¤Î¥¥ã¥é¤Ï¥Ü¥¿¥ó¤Ë¤Ê¤Ã¤Æ¤ª¤ê¡¢ÁªÂò¤·¤¿¥¥ã¥é¤Î¾ðÊ󤬥ݥåץ¢¥Ã¥×Æâ¤Î chooseCharaData ÊÑ¿ô¤ËÂåÆþ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢¤³¤Î¾ðÊó¤ò¥¥ã¥é¤òÀ¸À®¤·¤ÆÇÛÃÖ¤¹¤ë¥¯¥é¥¹Â¦¤Ø°ú¿ô¤òÄ̤¸¤ÆÅϤ¹¤³¤È¤¬¤Ç¤¤ì¤Ð¡¢¥¥ã¥é¤Î¾ðÊó¤ò¥Ý¥Ã¥×¥¢¥Ã¥×Æ⤫¤éÀ¸À®¥¯¥é¥¹¤Ø¤ÈÆϤ±¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡¡¦PlacementCharaSelectPopUp Æâ¤Î chooseCharaData ÊÑ¿ô¤ËÁªÂòÃæ¤Î¥¥ã¥é¤Î¾ðÊó(CharaData)¤¬ÂåÆþ¤µ¤ì¤Æ¤¤¤ë ¡¡¡¡¡¡¤³¤Î¾ðÊó¤òÀ¸À®¤¹¤ë¥¯¥é¥¹¤ØÆϤ±¤ë¤³¤È¤¬¤Ç¤¤ì¤Ð¡¢¤½¤Î¥¯¥é¥¹¤Ç¤â CharaData ¤Î¾ðÊó¤òÍøÍѤ·¤Æ¡¢¥¥ã¥é¤òÀ¸À®¤¹¤ë¤³¤È¤¬¤Ç¤¤ë ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¢ ¡¡¡¦CharaGenerator ¤Ë¿·¤·¤¤¥á¥½¥Ã¥É¤òºîÀ®¤·¡¢°ú¿ô¤Ç CharaData ¤ò¼õ¤±¼è¤ì¤ë¤è¤¦¤Ë¤¹¤ë ¡¡¡¡¡¡¤³¤Î¥á¥½¥Ã¥ÉÆâ¤Ç¥¥ã¥é¤ÎÀ¸À®¤È¥¥ã¥é¤Î¾ðÊó¤ÎÀßÄê¤ò¹Ô¤¨¤ë¤è¤¦¤Ë¤¹¤ë
¡¡¤Þ¤º¤Ï¥¥ã¥é¤ÎÀ¸À®¤Þ¤ÇÅþã¤Ç¤¤ë¤è¤¦¤Ë¥í¥¸¥Ã¥¯¤ò¹Í¤¨¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¡¡¿·¤·¤¯Äɲä·¤¿ 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 ¤òÍøÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¿·¤·¤¤¥¥ã¥é¤òºî¤ê½Ð¤¹¤³¤È¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¥×¥í¥°¥é¥à¤Ï¤³¤Î¤è¤¦¤Ë¡ÖƱ¤¸¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¢¤ê¤Ê¤¬¤é¿¶¤ëÉñ¤¤¤òÊѤ¨¤ë¡×½èÍý¤¬²Äǽ¤Ç¤¹¡£
¡¡¤µ¤é¤Ë¼¡¤Î¼ê½ç¤Ç¡¢ÇÛÃÖ¤·¤¿¥¥ã¥é¤Î¥¢¥Ë¥á¤ÎÀßÄê¤ò¹Ô¤Ã¤Æ´°À®¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡CharaData ¤Ë¤¢¤ë AttackRangeType ¤Î¾ðÊó¤ò³èÍѤǤ¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¡¢AttackRangeSizeSO ¥¹¥¯¥ê¥×¥¿¥Ö¥ë¡¦¥ª¥Ö¥¸¥§¥¯¥È¤ò DataBaseManager ¤Ë¤ª¤¤¤Æ°·¤¨¤ë¾õÂ֤ˤ·¤Þ¤¹¡£
¡¡¤Þ¤¿¡¢AttackRangeType ¤Ë¤è¤Ã¤Æ BoxCollider2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Size ¤òÊѹ¹¤Ç¤¤ë¤è¤¦¤Ë GetAttackRangeSize ¥á¥½¥Ã¥É¤òºîÀ®¤·¡¢°ú¿ô¤Ç¼õ¤±¼è¤Ã¤¿
AttackRangeType ¤Ë±þ¤¸¤¿ Size ¤Î¾ðÊó¤òÄ󶡤Ǥ¤ë¤è¤¦¤Ë½àÈ÷¤ò¤·¤Æ¤ª¤¤Þ¤¹¡£
DataBaseManager.cs
¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤·¤Þ¤¹¡£
¡¡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
¡¡CharaData ¤ò³èÍѤ·¤Æ CharaController Æâ¤Ë CharaData ¤Î¾ðÊó¤òÈ¿±Ç¤Ç¤¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Î¡¢½é´üÀßÄêÍѤΥ᥽¥Ã¥É¤òºîÀ®¤·¤Þ¤¹¡£
¤³¤Î¥á¥½¥Ã¥É¤Ï public ½¤¾þ»Ò¤ÇÀë¸À¤ò¹Ô¤¤¡¢ CharaGenerator ¤«¤é¸Æ¤Ó½Ð¤·¤ò¤·¤Æ¤â¤é¤Ã¤Æ¡¢¤½¤ÎºÝ¤Ë°ú¿ô¤È¤·¤Æ CharaData ¤Î¾ðÊó¤ò¼õ¤±¼è¤ì¤ëÀ߷פˤ·¤Þ¤¹¡£
¡¡¤³¤¦¤¹¤ë¤³¤È¤Ç¡¢CharaData ¤¬ CharaController ¤Þ¤ÇÆϤ¯¤³¤È¤Ë¤Ê¤ë¤¿¤á¡¢¡¢ÇÛÃÖ¤·¤¿¥¥ã¥é¤Ë¡¢¤½¤ì¤¾¤ì¤Î¾ðÊó¤òÀßÄꤷ¤ÆÇÛÃÖ¤ò¹Ô¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¹¶·âÈϰϤξðÊó¤Ç¤¢¤ë BoxCollider2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Size ¤Ë¤Ä¤¤¤Æ¤Ï¡¢Àè¤Û¤É DataBaseManager Æâ¤Ë¿·¤·¤¯Äɲä·¤¿ GetAttackRangeSize ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Æ
CharaData ¤Ë¤¢¤ë AttackRangeType ¤Ë¹ç¤ï¤»¤¿ Size ¤ËÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡£¤³¤Î½èÍý¤Ë¤è¤Ã¤Æ¡¢¥¥ã¥é¤Î¹¶·âÈϰϤòưŪ¤ËÊѤ¨¤ë¤³¤È¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
CharaController.cs
¡¡¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤¿¤é¥»¡¼¥Ö¤ò¹Ô¤¤¤Þ¤¹¡£
¡¡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 ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤òÍøÍѤ·¤Þ¤¹¤Î¤Ç¡¢³Îǧ¤¬½ª¤ï¤Ã¤¿¤é¡¢ºÆÅÙ¡¢¥¹¥¤¥Ã¥Á¤òÆþ¤ì¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£
¡¡¼¡¤Ï¡¡¼ê½ç£²£³¡¡¡ÝÇÛÃÖ¤·¤¿¥¥ã¥é¤Î¥¢¥Ë¥á¤ò¼«Æ°ÀßÄꤹ¤ë½èÍý¤Î¼ÂÁõ¡Ý¡¡¤Ç¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯