ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2020ǯ11·î25Æü(¿å) 20:40:50ÍúÎò
¡¡¥²¡¼¥à¤ò¥¯¥ê¥¢¤¹¤ë¾ò·ï¤òÀ߷פ·¡¢¤½¤Î¾ò·ï¤òËþ¤¿¤·¤¿ºÝ¤Ë¡¢GameClear ¥·¡¼¥ó¤Ø¤ÈÁ«°Ü¤¹¤ë½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¡¡¤Þ¤º¤Ï GameClear ¥·¡¼¥ó¤òºîÀ®¤·¤Æ¤ª¤¤Þ¤¹¡£
¡¡¼¡¤Ë¡¢¤É¤Î¤è¤¦¤Ê¥¯¥ê¥¢¾ò·ï¤¬¤è¤¤¤«¤ò¹Í¤¨¤Æ¡¢¤½¤Î¥í¥¸¥Ã¥¯¤òÀ߷פ·¤Þ¤¹¡£
º£²ó¤Ï¡¢Main ¥·¡¼¥óÆâ¤Ë¤¤¤ë Enemy ¥¿¥°¤ò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤ò¤¹¤Ù¤ÆÇ˲õ¤·¤¿¤é¡¢GameClear ¥·¡¼¥ó¤ØÁ«°Ü¤¹¤ë¡¢¤È¤¤¤¦¾ò·ï¤È¤·¤Þ¤¹¡£
¡¡¾ò·ï¤Ï·è¤Þ¤ê¤Þ¤·¤¿¤Î¤Ç¡¢Â³¤¤¤Æ¡¢¤³¤Î¾ò·ï¤Î¥í¥¸¥Ã¥¯¤òÁȤि¤á¤Ë¤Ï¡¢¤É¤ó¤Ê¾ðÊó¤¬É¬ÍפȤʤ뤫¤ò²¿¤«¤ò¹Í¤¨¤Æ¤¤¤¤Þ¤¹¡£
¡¡¡ÖEnemy ¥¿¥°¤ò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤ò¤¹¤Ù¤ÆÇ˲õ¤·¤¿¤é¡×¤È¤¤¤¦¤³¤È¤Ï¡ÖEnemy ¥¿¥°¤ò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤¬¥·¡¼¥óÆâ¤Ë£°¸Ä¤Ë¤Ê¤Ã¤¿¤é¡×¤È¹Í¤¨¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¤³¤Î¾ò·ï¤ò¹Í¤¨¤¿¤È¤¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ðÊó¤ò´ÉÍý¤Ç¤¤Æ¤¤¤Ê¤±¤ì¤Ð¾ò·ï¼°¤È¤·¤ÆÁȤßΩ¤Æ¤ë¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£
¤Ä¤Þ¤ê¡¢¥²¡¼¥à¥·¡¼¥óÆâ¤Ë¡¢Enemy ¤È¤¤¤¦¥¿¥°¤ò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤¬²¿¸Ä¤¢¤ë¤Î¤«¤¬Ê¬¤«¤é¤Ê¤±¤ì¤Ð¡¢¤³¤Î¾ò·ï¼°¤Ï¹½ÃۤǤ¤Ê¤¤¤¿¤á¤Ç¤¹¡£
¡¡Enemy ¥¿¥°¤ò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤Ë´Ø¤·¤Æ¤Ï¡¢°ÊÁ°¤ËºîÀ®¤·¤¿¡¢StopAttackItem ¥¹¥¯¥ê¥×¥È¤¬Ìò¤ËΩ¤Ä¤Ç¤·¤ç¤¦¡£
¤³¤Î½èÍýÆâ¤Ç¤Ï¡¢¥¿¥°¤ò»ý¤ÄÊ£¿ô¤Î¥ª¥Ö¥¸¥§¥¯¥È¤òõ¤·¤ÆÇÛÎó¤ËÂåÆþ¤¹¤ë¤È¤¤¤¦½èÍý¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤½¤ì¤ò±þÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
¡ã±þÍѤ¹¤ë¡ä
targets = GameObject.FindGameObjectsWithTag("EnemyShotShell");
¡¡º£²ó¤Ï¾ò·ï¤òËþ¤¿¤·¤¿¤é¥·¡¼¥óÁ«°Ü¤ò¹Ô¤¦¤³¤È¤¬ÌÜŪ¤Ç¤¹¤Î¤Ç¡¢¤³¤ÎŨ¤Î¿ô¤ò¼èÆÀ¤¹¤ë½èÍý¤Ï¡¢¥·¡¼¥óÁ«°Ü½èÍý¤¬µ½Ò¤µ¤ì¤Æ¤¤¤ë¥¹¥¯¥ê¥×¥È¤ØÄɵ¤¹¤ë¤È¤¤¤¤¤Ç¤·¤ç¤¦¡£
Î㤨¤Ð¡¢TankHealth ¥¹¥¯¥ê¥×¥È¤Ë¤Ï¡¢¥²¡¼¥à¥ª¡¼¥Ð¡¼¥·¡¼¥ó¤Ø¤ÎÁ«°Ü½èÍý¤¬µ½Ò¤µ¤ì¤Æ¤¤¤ë¤¿¤á¡¢using ¤Ë¥·¡¼¥óÁ«°ÜÍѤÎÀë¸À¤¬Äɲ䵤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤Î¥¹¥¯¥ê¥×¥È¤òÍøÍѤ·¤Þ¤·¤ç¤¦¡£
¡¡¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ðÊ󤬼èÆÀ¤Ç¤¤Þ¤·¤¿¤¬¡¢¤³¤Î¾ðÊó¤Ï GameObject ·¿¤Ç¤Î¼èÆÀ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
º£²ó¤Ï²¿¸Ä¤¢¤ë¤Î¤«¡¢¤È¤¤¤¦¤³¤È¤ò¿ô»ú¤È¤·¤Æ´ÉÍý¤·¤¿Êý¤¬´ÉÍý¤·¤ä¤¹¤¤¤Î¤Ç¡¢¤³¤Î¾ðÊó¤ò¸µ¤Ë¤·¤Æ¡¢Å¨¤Î¿ô¤ò°·¤¨¤ë¤è¤¦¤Ë¿·¤·¤¯ int ·¿¤ÎÊÑ¿ô¤òÍÑ°Õ¤·¤Þ¤¹¡£
¤³¤ì¤â TankHealth ¥¹¥¯¥ê¥×¥È¤ËÀë¸À¤·¤ÆÍÑ°Õ¤·¤Æ¤ª¤¤Þ¤·¤ç¤¦¡£
¡¡Enemy ¥¿¥°¤Ç¼èÆÀ¤·¤¿ GameObject ·¿¤ÎÇÛÎó¤Î¾ðÊó¤Ï¡¢ÇÛÎó¤ÎºÇÂç¿ô¤ò¼èÆÀ¤¹¤ë¤³¤È¤Ç¡¢¤½¤Î¤Þ¤Þ¡ÖŨ¤Î»Ä¤ê¤Î¿ô¡×¤ÈÆɤßÂؤ¨¤ë¤³¤È¤¬½ÐÍè¤ë¤¿¤á¤Ç¤¹¡£
¤³¤ì¤ò int ·¿¤ÎÊÑ¿ô¤ËÂåÆþ¤·¤Æ¡¢Å¨¤Î¿ô¤òÇÄ°®½ÐÍè¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£ÇÛÎó¤ÎŤµ¤ÎºÇÂçÃͤϡÖLength¡×¤Ç¼èÆÀ½ÐÍè¤Þ¤¹¡£
¡¡¤¢¤È¤Ï¡¢¤³¤ÎŨ¤Î¿ô¤ò¡¢¤É¤Î¤è¤¦¤Ë´ÉÍý¤ò¤·¤Æ¤¤¤¯¤«¤ò¹Í¤¨¤Æ¤¤¤¤Þ¤¹¡£
Ũ¤Î¿ô¤Ï¡¢Å¨¤¬Ç˲õ¤µ¤ì¤¿ºÝ¤Ë¸º¤é¤·¤Æ¤¤¤¯¤è¤¦¤Ë¥í¥¸¥Ã¥¯¤òÁȤá¤Ð¡¢¤ï¤«¤ê¤ä¤¹¤¯¡¢½èÍý¤¬¤Ä¤¯¤ê¤ä¤¹¤¤¤Ç¤·¤ç¤¦¡£
¡¡¤³¤³¤Ç¤Ï¡¢°ÊÁ°¤Ë³Ø½¬¤·¤¿¥Ö¥í¥Ã¥¯Êø¤·¤Î¥í¥¸¥Ã¥¯¤¬±þÍѤǤ¤Þ¤¹¡£
¥Ö¥í¥Ã¥¯Êø¤·¤Ç¤Ï¡¢¥Ö¥í¥Ã¥¯¤¬Ç˲õ¤µ¤ì¤ë¤¿¤Ó¤Ë¡¢GameMaster ¥¹¥¯¥ê¥×¥È¤¬´ÉÍý¤·¤Æ¤¤¤ë BoxNum ¤Î¿ô¤ò£±¤Ä¸º¤é¤·¤Æ¤¤¤¯½èÍý¤ò¼ÂÁõ¤·¤Æ¤¤¤Þ¤·¤¿¡£
¤³¤ì¤ò¾å¼ê¤¯ÍøÍѤ·¤Þ¤·¤ç¤¦¡£
¡¡Å¨¤¬Ç˲õ¤µ¤ì¤ë½èÍý¤Ï DestroyObjest ¥¹¥¯¥ê¥×¥ÈÆâ¤Ëµ½Ò¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤³¤³¤Ë¡¢¥Ö¥í¥Ã¥¯Êø¤·¤Î Destroyer ¥¹¥¯¥ê¥×¥È¤ò»²¹Í¤Ë¤·¤Ê¤¬¤é
Ũ¤Î»Ä¿ô¤ò¸º¤é¤·¤Æ¤¤¤¯½èÍý¤ÎÄɲäò¹Ô¤¤¤Þ¤¹¡£
¡ã¥Ö¥í¥Ã¥¯Êø¤·¤Î Destroyer ¥¹¥¯¥ê¥×¥È¤ò±þÍѤ¹¤ë¡ä
masterObj.GetComponent<GameMaster>().boxNum--;¡¡¡¡<=¡¡¤³¤ì¤Ï¡¢boxNum ÊÑ¿ô¤¬ public ½¤¾þ»Ò¤Ê¤Î¤Ç¼Â¹Ô¤Ç¤¤Þ¤¹¡£
¡¡¹Í¤¨Êý¤È¤·¤Æ¤Ï¡¢Æ±¤¸¤è¤¦¤ÊÊÑ¿ô¤ÎÀ߷פˤ¹¤ë¤«¡¢¤¢¤ë¤¤¤Ï¡¢TankHealth ¥¹¥¯¥ê¥×¥È¤ËŨ¤Î¿ô¤ò¸º¤é¤¹¥á¥½¥Ã¥É¤òÍÑ°Õ¤·¤Æ¸Æ¤Ó½Ð¤¹¤è¤¦¤Ë¤¹¤ë¤«¡¢¤Ç¤¹¡£
¡¡
¡¡
¡¡¥¹¥¯¥ê¥×¥È¤Ë½èÍý¤òµ½Ò¤¹¤ëºÝ¤Ë¤Ï¡¢ÆüËܸì¤Î¥³¥á¥ó¥È¤ò»öÁ°¤Ë½ñ¤¤¤Æ¤ª¤¤¤Æ¡¢¤½¤ì¤ò¸µ¤Ë¥×¥í¥°¥é¥à¤ò½ñ¤¤¤Æ¤¤¤¯¼êË¡¤¬¤ª¤¹¤¹¤á¤Ç¤¹¡£
¥í¥¸¥Ã¥¯¤ò¹½ÃÛ¤·¤ä¤¹¤¤¤Ç¤¹¤·¡¢¥³¥á¥ó¥È¤¬¤½¤Î¤Þ¤Þ»Ä¤ê¡¢½èÍý¤Î½ñ¤±Ì¤é¤·¤òËɤ°¤³¤È¤¬½ÐÍè¤ë¤¿¤á¤Ç¤¹¡£
¡¡À߷פò¸µ¤Ë¡¢°Ê²¼¤Î¼ê½ç¤Ç¼ÂÁõ¤ò¹Ô¤¤¤Þ¤¹¡£¤Þ¤º¤Ï¼«Ê¬¤Ç¥í¥¸¥Ã¥¯¤ò¹Í¤¨¤Æ¼ÂÁõ¤ËÄ©À路¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¤Þ¤¿¡¢¤³¤³¤Ë¤¢¤ë½èÍý¤ÏɬÍ׺ÇÄã¸Â¤Î½èÍý¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢¼«Ê¬¤Ê¤ê¤Ë¥¢¥ì¥ó¥¸¤ò¼«Í³¤Ë¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£
¡¡¤³¤Î¼ÂÁõÎã¤Ç¤Ï¡¢Å¨¤Î¿ô¤Î´ÉÍý¤Ï private ½¤¾þ»Ò¤ÎÊÑ¿ô¤Ç¹Ô¤¦¤è¤¦¤ËÀ߷פ·¤Æ¤¤¤Þ¤¹¡£
¤½¤Î¤¿¤áŨ¤¬Ç˲õ¤µ¤ì¤¿ºÝ¤Ë¡¢TankHealth ¥¹¥¯¥ê¥×¥È¤ËÍÑ°Õ¤·¤¿¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ¡¢¤³¤ÎŨ¤Î»Ä¤ê¿ô¤ò¸º»»¤¹¤ë½èÍý¤Ç¥í¥¸¥Ã¥¯¤òÁȤó¤Ç¤¤¤Þ¤¹¡£
¡¡£±¡¥GameClear¥·¡¼¥ó¤òºîÀ®¤¹¤ë ¡¡£²¡¥TankHealth ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤Æ¡¢Å¨¤Î»Ä¤ê¿ô¤ò´ÉÍý¤·¡¢¥«¥¦¥ó¥È¤¹¤ë¤¿¤á¤Î½èÍý¤òÄɲä¹¤ë ¡¡£³¡¥DestroyObject ¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤Æ¡¢Å¨¤¬Ç˲õ¤µ¤ì¤¿ºÝ¤Ë TankHealth ¤Î CalculateEnemyCount ¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹½èÍý¤òÄɲä¹¤ë ¡¡£´¡¥¥²¡¼¥à¤ò¼Â¹Ô¤·¤ÆÆ°ºî¤ò³Îǧ¤¹¤ë
¡¡Scenes ¥Õ¥©¥ë¥ÀÆâ¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤ò³«¤¡¢Create => Scene ¤òÁªÂò¤·¤Þ¤¹¡£
¿·¤·¤¯ Scene ¤¬ºîÀ®¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢Ì¾Á°¤ò GameClear(¤¢¤ë¤¤¤Ï¤½¤ì¤ËÎà»÷¤¹¤ë̾¾Î)¤ËÊѹ¹¤·¤Þ¤¹¡£
¥À¥Ö¥ë¥¯¥ê¥Ã¥¯¤·¤Æ¡¢GameClear ¥·¡¼¥ó¤ò³«¤¤¤ÆÊÔ½¸¤ò¹Ô¤¤¤Þ¤¹¡£
¡ã¼ê½çÆ°²è¡¡¿·¤·¤¤Scene¤òºîÀ®¡ä
https://gyazo.com/5e1efa2d65c4a70be5fffc55f0009882
¥Õ¥©¥ë¥À²èÁü
¡¡Canvas ¤ò¿·¤·¤¯ºîÀ®¤·¤Æ¡¢Text¡¢¤¢¤ë¤¤¤Ï Image ¤ò»ý¤Ä¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÄɲä·¡¢¥²¡¼¥à¥¯¥ê¥¢¤Îɽ¼¨¤òºîÀ®¤·¤Þ¤¹¡£
¡¡Image¤ÇºîÀ®¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¥²¡¼¥à¥¯¥ê¥¢¤Îʸ»ú¤Î¥í¥´¤òºîÀ®¤·¡¢¤½¤ì¤ò Image ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Sourece Image ¤ËÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£
¡¡Text¤ÇºîÀ®¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢Text ¥×¥í¥Ñ¥Æ¥£Íó¤Ë "GameClear" ¤ÈÆþÎϤ·¤Æ¤ª¤¤Þ¤¹¡£
¡¡¤É¤Á¤é¤ÎÊýË¡¤Ç¼ÂÁõ¤·¤Æ¤¤¤¿¤À¤¤¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£¤Þ¤¿Â¾¤ÎÁõ¾þ(BGM¤ÎºÆÀ¸¡¢ÇطʲèÁü¤ÎÀßÃ֤ʤÉ)¤â¼«Í³¤Ë¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£
¡¡º£²ó¤ÎÎã¤Ç¤Ï Text ¤Ë¤Æʸ»ú¤È¤·¤Æ GameClear ¤òɽ¼¨¤µ¤»¤Æ¤¤¤Þ¤¹¡£
¡¡
¡ã»²¹Í²èÁü¡ä
¡¡¥¯¥ê¥¢¾ò·ï¤Î¥í¥¸¥Ã¥¯¤ò¹½ÃÛ¤¹¤ë¤¿¤á¤ËɬÍפÊÊÑ¿ô¤ò£±¤ÄÄɲä·¤Þ¤¹¡£
Ũ¤Î¿ô(»Ä¤ê¤Î¿ô)¤ò´ÉÍý¤¹¤ë¤¿¤á¤Ë¡¢int ·¿¤Î enemyCount ÊÑ¿ô¤òÍÑ°Õ¤·¤Þ¤¹¡£
¤³¤ÎÃͤˤϡ¢Start ¥á¥½¥Ã¥ÉÆâ¤ÇEnemy ¥¿¥°¤ò»ý¤ÄŨ¤òÇÛÎó¤Ç¼èÆÀ¤·¤¿¸å¤ËÇÛÎó¤ÎŤµ¡ÊºÇÂçÃ͡ˤòÂåÆþ¤·¤Þ¤¹¡£
²¿¸Î¤Ê¤é¤Ð¡¢¤³¤ÎÇÛÎó¤ÏŨ¤Î¾ðÊó¤¬ÂåÆþ¤µ¤ì¤Æ¤ª¤ê¡¢Å¨¤Î¿ôʬ¤À¤±Í×ÁǤò»ý¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£
¡¡¤Þ¤¿¤³¤Î enemyCount ÊÑ¿ô¤Ï private ½¤¾þ»Ò¤Ç¤¢¤ë¤¿¤á¡¢³°Éô¤Î¥¹¥¯¥ê¥×¥È¤«¤é¤ÏľÀÜ»²¾È¤·¤ÆÁý¸º½èÍý¤ò¹Ô¤¦¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£
³°Éô¤Î¥¹¥¯¥ê¥×¥È¤«¤é¸Æ¤Ó½Ð¤·¤Æ¤â¤é¤¦¤¿¤á¤Ë public ¤Î CalculateEnemyCount ¥á¥½¥Ã¥É¤òÍÑ°Õ¤·¤Æ¡¢¸º»»¤ò¹Ô¤¦ºÝ¤Ë¤Ï¤³¤Î¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ¤â¤é¤¦¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡¤³¤Î¥á¥½¥Ã¥ÉÆâ¤Ç¤Ï enemyCount ÊÑ¿ô¤Î¸º»»¸å¤Ë¡¢Å¨¤Î¿ô¤¬¥¯¥ê¥¢¤Î¾ò·ï¤òËþ¤¿¤·¤Æ¤¤¤ë¤«¡¡=¡¡enemyCount ÊÑ¿ô¤ÎÃͤ¬ 0 ¤«¤É¤¦¤«¤òȽÄꤹ¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢
Ũ¤Î¿ô¤Î¥«¥¦¥ó¥È¥À¥¦¥ó¤È¥¯¥ê¥¢¤ÎȽÄê¤ò°ì½ï¤Ë¹Ô¤¦¤è¤¦¤Ë¥í¥¸¥Ã¥¯¤òÁȤó¤Ç¤¤¤Þ¤¹¡£
TankHealth.cs
¡¡°Ê¾å¤Ç¼ÂÁõ¤Ï½ªÎ»¤Ç¤¹¡£¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ¡¢¥¯¥ê¥¢¤Î¾ò·ï¤òËþ¤¿¤¹½èÍý¤¬Àµ¾ï¤ËÀ©¸æ¤µ¤ì¤Æ¤¤¤ë¤«¤ò³Îǧ¤·¤Þ¤¹¡£
¡¡¤Þ¤º¤Ï enemyCount ¤ÎÃͤ¬Àµ¾ï¤ËÂåÆþ¤µ¤ì¤¿¤«¤ò¡¢Console ¥Ó¥å¡¼¤Ç³Îǧ¤ò¹Ô¤¤¤Þ¤¹¡£
TankHealth ¥¹¥¯¥ê¥×¥È¤Î Start ¥á¥½¥Ã¥É¤Ë Debug.Log ¥á¥½¥Ã¥É¤ò½ñ¤¤¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤³¤³¤Ç¥Ò¥¨¥é¥ë¥¡¼¤Ë¤¤¤ë Enemy ¥¿¥°¤ò»ý¤ÄŨ¤Î¿ô¤È
¤³¤Î enemyCount ¤ÎÃͤ¬Æ±¤¸¤«¤É¤¦¤«¤ò³Îǧ¤·¤Þ¤¹¡£
º£²ó¤ÎÎã¤Ç¤Ï¥Ò¥¨¥é¥ë¥¡¼¤ËEnemy ¥¿¥°¤ò»ý¤Ä¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬£²¤Ä¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢Console ¤Ë¤â £² ÂΤÈɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¡Ê¼«Ê¬¤Î¥×¥í¥¸¥§¥¯¥È¤Ë¤¢¤ë Enemy ¥¿¥°¤ò»ý¤Ä¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¿ô¤Ç³Îǧ¤·¤Þ¤·¤ç¤¦¡Ë
Console ¥Ó¥å¡¼²èÁü
¡¡¤½¤Î¤Þ¤Þ Enemy ¥¿¥°¤ò»ý¤ÄŨ¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤·¤Æ¤ß¤Þ¤¹¡£
DestroyObjest ¥¹¥¯¥ê¥×¥È¤Î OnTiriggerEnter ¥á¥½¥Ã¥ÉÆâ¤Ëµ½Ò¤·¤¿¡¢TankHealth ¥¹¥¯¥ê¥×¥È¤Î CalculateEnemyCount ¥á¥½¥Ã¥É¤Î¸Æ¤Ó½Ð¤·¤¬¼Â¹Ô¤µ¤ì¤Æ
Console ¥Ó¥å¡¼¤Ë Ũ¤Î¿ô¤¬¹¹¿·¤µ¤ì¤¿É½¼¨¤¬¤Ç¤ì¤ÐÀ®¸ù¤Ç¤¹¡£
Console ¥Ó¥å¡¼²èÁü
¡ã¸¡¾ÚÆ°²è¡¡Enemy ¥¿¥°¤ò»ý¤Ä¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤¹¤ë¤È¡¢EnemyCount ¤¬¸º»»¤µ¤ì¤ë¡ä
https://gyazo.com/ac26c64a50c94ca550c35124c4aec408
¡¡ÊɤòÇ˲õ¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
¤³¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¿¥°¤Ï Enemy ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤Î¤Ç¡¢Æ±¤¸ DestroyObjest ¥¹¥¯¥ê¥×¥È¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬À©¸æ¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç
TankHealth ¥¹¥¯¥ê¥×¥È¤Î CalculateEnemyCount ¥á¥½¥Ã¥É¤Î¸Æ¤Ó½Ð¤·¤Ï¹Ô¤ï¤ì¤Þ¤»¤ó¡£
Enemy ¥¿¥°¤ò»ý¤¿¤Ê¤¤¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤·¤Æ¤â¡¢EnemyCount ¤Ï¸º»»¤µ¤ì¤Ê¤¤
https://gyazo.com/9919113d35a7658f1a3152e349eb46de
¡¡»Ä¤Ã¤¿Å¨¤ò¤¹¤Ù¤ÆÇ˲õ¤·¤Æ¡¢Å¨¤Î¿ô¤ò 0 ¤Ë¤·¤¿¤È¤¤Ë¡¢¼«Æ°Åª¤Ë GameClear ¥·¡¼¥ó¤ØÁ«°Ü¤¹¤ì¤ÐÀ®¸ù¤Ç¤¹¡£
Console ¤Ë¤â GameClear ¤Îɽ¼¨¤¬½Ð¤Þ¤¹¡£
Console ¥Ó¥å¡¼²èÁü
Enemy ¥¿¥°¤ò»ý¤Ä¤¹¤Ù¤Æ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤¹¤ë¤È GameClear ¥·¡¼¥ó¤ØÁ«°Ü¤¹¤ë
https://gyazo.com/cdfd3c87ea36a7f879a7904513cf24ea
¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£¤ª¤Ä¤«¤ì¤µ¤Þ¤Ç¤·¤¿¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯