ºÇ½ª¹¹¿·¡§
orika_ex_miyako 2021ǯ02·î17Æü(¿å) 13:17:53ÍúÎò
¼ê½ç£±£¹¡¡¡¼¥¹¥³¥¢¤ò¼ÂÁõ¡¼
£³£·¡¥CanvasÆâ¤ËUIÉôÉʤòºîÀ®¤¹¤ë¤¡Ê¥¹¥³¥¢É½¼¨Éôʬ¡Ë £³£¸¡¥GameData¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤¹¤ë¢(¥¹¥³¥¢¤òÅÐÏ¿¤·¤Æ´ÉÍý¤Ç¤¤ë¤è¤¦¤Ë¤¹¤ë) £³£¹¡¥UI´ÉÍý¤ò¹Ô¤¦UIManager¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤¹¤ë¢(¥¹¥³¥¢É½¼¨¤Î¹¹¿·¡Ë £´£°¡¥BattleManager¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤¹¤ë¢¡Ê¥¹¥³¥¢¤ò²Ã»»¤¹¤ë½èÍý¤òÄɲ乤ë¡Ë £´£±¡¥EnemyBall¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤Æ¡¢Money¤òÀßÄꤹ¤ë
¡¡¿·¤·¤¤³Ø½¬ÆâÍƤϡ¢°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
¡¦
¡¡CanvasÆâ¤ËºîÀ®¤·¤Æ¤¢¤ëTop_UI ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¡¢¥¹¥³¥¢¤Îɽ¼¨¤ò¹Ô¤¦¤¿¤á¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÄɲ䷤Ƥ¤¤¤Þ¤¹¡£
¡¡ÍÑ°Õ¤¹¤ë¤Î¤Ï¡¢¥Õ¥©¥ë¥ÀÍѤΥ²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤È¡¢¤½¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¹¥³¥¢É½¼¨ÍѤÎText¡¢Image¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò»ý¤Ä¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤¹¡£
¤³¤Î¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò UIManager¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤·¤ÆÁàºî½ÐÍè¤ë¤è¤¦¤Ë¤·¡¢¥²¡¼¥àÆâ¤Ç³ÍÆÀ¤·¤¿¥¹¥³¥¢¤È¤½¤Îɽ¼¨¤È¤òƱ´ü¤µ¤»¤Æɽ¼¨¤·¤Þ¤¹¡£
¡¡¤Ê¤ª¥¹¥³¥¢¤Ï Money ¤È¤¤¤¦ÍѸì¤Ç°·¤¤¤Þ¤¹¡£
¡¡½çÈ֤˺îÀ®¤·¤Æ¤¤¤¤Þ¤¹¡£
¡¡¥Ò¥¨¥é¥ë¥¡¼¤Î Top_UI ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¾å¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤òɽ¼¨¤·¡¢Create Empty ¤òÁªÂò¤·¤Þ¤¹¡£
̾Á°¤ò MoneyPlace ¤ËÊѹ¹¤·¤Þ¤¹¡£¤³¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ï¤³¤ì¤«¤éºîÀ®¤¹¤ë»þ´Öɽ¼¨ÍѤΥ²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Õ¥©¥ë¥À¤È¤·¤Æ¤ÎÌò³ä¤ò»ý¤Á¤Þ¤¹¡£
ºîÀ®¸å¡¢¥Ò¥¨¥é¥ë¥¡¼¤ò³Îǧ¤·¤Æ¡¢CanvasÆâ¤Ç¤Î°ÌÃÖ¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
²¼µ¤Î²èÁü¤Î¤è¤¦¤Ê¿Æ»Ò´Ø·¸¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤ÐÂç¾æÉפǤ¹¡£¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤ÏºÆÅÙºîÀ®¤·¤Æ¤¯¤À¤µ¤¤¡£
¥Ò¥¨¥é¥ë¥¡¼²èÁü
![](https://image02.seesaawiki.jp/i/o/i-school-memo/IPbFeJ6upv-s.png)
¡¡MoneyPlace ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ò³Îǧ¤·¡¢ Position Y ¼´¤Î°ÌÃÖ¤òÄ´À°¤·¤Þ¤¹¡£
²èÁüÀßÄê¸å¤Ë¤â¡¢Å¬µ¹Ä´À°¤ò¤·¤Æ¸«¤ä¤¹¤¤°ÌÃ֤ˤʤë¤è¤¦¤Ë½¤Àµ¤·¤Æ¤¯¤À¤µ¤¤¡£
MoneyPlace ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
![](https://image01.seesaawiki.jp/i/o/i-school-memo/1wovKcUGzR-s.png)
MoneyPlace ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡Scene¥Ó¥å¡¼²èÁü
![](https://image01.seesaawiki.jp/i/o/i-school-memo/KOXbS58g6j-s.jpg)
¡¡MoneyPlace ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¾å¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤òɽ¼¨¤·¡¢UI => Image ¤òÁªÂò¤·¡¢Ì¾Á°¤ò imgMoney ¤ËÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£
ºîÀ®¸å¡¢¥Ò¥¨¥é¥ë¥¡¼¤ò³Îǧ¤·¤Æ¡¢CanvasÆâ¤Ç¤Î°ÌÃÖ¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£²¼µ¤Î²èÁü¤Î¤è¤¦¤Ê¿Æ»Ò´Ø·¸¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤ÐÂç¾æÉפǤ¹¡£
¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤ÏºÆÅÙºîÀ®¤·¤Æ¤¯¤À¤µ¤¤¡£
¥Ò¥¨¥é¥ë¥¡¼²èÁü
![](https://image01.seesaawiki.jp/i/o/i-school-memo/1d9uX6nVq1-s.png)
¡¡Image ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò³Îǧ¤·¤Æ¡¢Source Image ¥×¥í¥Ñ¥Æ¥£¤ËǤ°Õ¤Î²èÁü¤òÀßÄꤷ¤Þ¤¹¡£ÁǺà¤Ï̵ÎÁÁǺà¤òõ¤·¤ÆUnity¤Ë¥¤¥ó¥Ý¡¼¥È¤·¤ÆÍøÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
Money¤È¤¤¤¦¥³¥ó¥»¥×¥È¤Ç¤¹¤Î¤Ç¥³¥¤¥ó¤ä¤ª¶â¤òɽ¤¹¤è¤¦¤Ê²èÁü¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
¡¡²èÁü¤òÀßÄꤷ¤¿¤é¡¢Â礤µ¤òÄ´À°¤·¤Þ¤¹¡£RectTransform¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò²èÁü¤ò»²¹Í¤Ë¤·¤Ê¤¬¤éÄ´À°¤·¤Æ¤¯¤À¤µ¤¤¡£
ÀßÄꤷ¤Æ¤¤¤ë²èÁü¤Ë±þ¤¸¤ÆŬµ¹¤ÊÂ礤µ¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
imgMoney ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
![](https://image01.seesaawiki.jp/i/o/i-school-memo/vd7pS7yCof-s.png)
imgMoney ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡Scene¥Ó¥å¡¼²èÁü
![](https://image02.seesaawiki.jp/i/o/i-school-memo/sfZ7tN5jrG-s.jpg)
¡¡MoneyPlace ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¾å¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤òɽ¼¨¤·¡¢UI => Image ¤òÁªÂò¤·¡¢Ì¾Á°¤ò txtMoney ¤ËÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£
ºîÀ®¸å¡¢¥Ò¥¨¥é¥ë¥¡¼¤ò³Îǧ¤·¤Æ¡¢CanvasÆâ¤Ç¤Î°ÌÃÖ¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£²¼µ¤Î²èÁü¤Î¤è¤¦¤Ê¿Æ»Ò´Ø·¸¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤ÐÂç¾æÉפǤ¹¡£
¤Ê¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤ÏºÆÅÙºîÀ®¤·¤Æ¤¯¤À¤µ¤¤¡£
¥Ò¥¨¥é¥ë¥¡¼²èÁü
![](https://image02.seesaawiki.jp/i/o/i-school-memo/cfzff6QRgU-s.png)
¡¡Text ¥³¥ó¥Ý¡¼¥Í¥ó¥ÈÆâ¤Î Raycast Target ¤Î¥¹¥¤¥Ã¥Á¤ò¥ª¥Õ¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
¤Þ¤¿ Text Íó¤Ç¤¹¤¬¡¢Ê¸»ú¤ÎÂ礤µ¤òÄ´À°¤·¡¢¿ô»ú¤¬5·å°Ì¤Þ¤ÇʤÖÄøÅÙ¤ÎÂ礤µ¤òÍÑ°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
Ä´À°¤¬½ª¤ï¤Ã¤¿¤é 0 ¤ÈÆþÎϤ·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
¡¡RectTransform¥³¥ó¥Ý¡¼¥Í¥ó¥È¤â¡¢Ê¸»ú¤ÎÂ礤µ¤È imgMoney ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÇÀßÄꤷ¤¿²èÁü¤ÎÂ礤µ¤Ë¹ç¤ï¤»¤ÆŬµ¹¤ÊÂ礤µ¤ËÄ´À°¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡Â³¤±¤Æ¡¢Canvas Renderer¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Cull Transparent Mesh ¤Î¥Á¥§¥Ã¥¯¤ò¥ª¥ó¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
txtMoney ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡Scene¥Ó¥å¡¼²èÁü
![](https://image01.seesaawiki.jp/i/o/i-school-memo/c8vP3uxoh7-s.jpg)
txtMoney ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü¡
![](https://image02.seesaawiki.jp/i/o/i-school-memo/fxsOwKpNN5-s.png)
txtMoney ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü¢
![](https://image01.seesaawiki.jp/i/o/i-school-memo/Q8YwHPxfQy-s.png)
¡¡°Ê¾å¤Ç¥¹¥³¥¢É½¼¨ÍѤÎUI¤ÎÄɲäϽªÎ»¤Ç¤¹¡£
¡¡Money¤Ë¤Ä¤¤¤Æ¤ÏGameData¥¯¥é¥¹¤ÈBattleManager¥¯¥é¥¹¤ËÅÐÏ¿¤·¡¢¤½¤ì¤¾¤ì¤¬Ê̤ÎÌò³ä¤ò²Ì¤¿¤¹¤è¤¦¤ËÀ߷פˤ·¤Þ¤¹¡£
¡¡GameData¥¯¥é¥¹¤Ë¤Ï¡¢totalMoney ÊÑ¿ô¤òÍÑ°Õ¤·¡¢¤¤¤Þ¤Þ¤Ç³ÍÆÀ¤·¤¿Money¤ÎÁí¿ô¤ò´ÉÍý¤µ¤»¤Þ¤¹¡£
¡¡
¡¡BattleManager¥¯¥é¥¹¤Ë¤Ï¡¢money ÊÑ¿ô¤òÍÑ°Õ¤·¡¢1²ó¤Î¥²¡¼¥à¥×¥ì¥¤¤Ç³ÍÆÀ¤·¤¿Money¤ò´ÉÍý¤µ¤»¤Þ¤¹¡£
¡¡Î®¤ì¤È¤·¤Þ¤·¤Æ¤Ï¡¢¥²¡¼¥àÃæ¤Î³ÍÆÀ¤·¤¿Money¤Ï°ì»þŪ¤ËBattleManager¥¯¥é¥¹¤Î money ÊÑ¿ô¤Ë¤Æ´ÉÍý¤ò¹Ô¤¤¤Þ¤¹¡£
¥²¡¼¥à¤ò¥¯¥ê¥¢¤Ç¤¤ë¤«¤ï¤«¤é¤Ê¤¤¤¿¤á¡¢¤¹¤°¤Ë¤Ï totalMoney ÊÑ¿ô¤Ë¤Ï²Ã»»¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡¤½¤·¤Æ¥²¡¼¥à¤ò¥¯¥ê¥¢¤·¤Æ¤Ï¤¸¤á¤Æ¡¢¤³¤Î moneyÊÑ¿ô¤ò¥×¥ì¥¤¥ä¡¼¤¬³ÍÆÀ¤·¡¢totalMoney ÊÑ¿ô¤Ë²Ã»»¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡GameData¥¹¥¯¥ê¥×¥È¤Î½¤Àµ¤¬½ªÎ»¤·¤¿¤é¡¢GameData¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¤Æ¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ò³Îǧ¤·¤Þ¤¹¡£
¿·¤·¤¯ºîÀ®¤·¤¿ totalMoney ÊÑ¿ô¤Î¥¢¥µ¥¤¥ó¾ðÊó¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
¤³¤Á¤é¤Ï¥¹¥Æ¡¼¥¸¥¯¥ê¥¢»þ¤Ë¥¯¥ê¥¢Ê󽷤Ȥ·¤Æ²Ã»»¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢ºÇ½é¤Ï 0 ¤Î¤Þ¤Þ¤ÇÌäÂꤢ¤ê¤Þ¤»¤ó¡£
GameData¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
![](https://image01.seesaawiki.jp/i/o/i-school-memo/Zm1mF5sDIf-s.png)
¡¡Money¤Îɽ¼¨¤ò¹¹¿·¤¹¤ë½èÍý¤òUIManager¤Ë¹Ô¤ï¤»¤Þ¤¹¡£
Money¤Î¿ô»úɽ¼¨¤Î¹¹¿·¤ò¹Ô¤¦¤¿¤á¤Î¥á¥½¥Ã¥É¤òÍÑ°Õ¤·¤Æ¡¢Money¤¬²Ã»»¤µ¤ì¤ë¤¿¤Ó¤Ë¤³¤Î¥á¥½¥Ã¥É¸Æ¤Ó½Ð¤¹¤è¤¦¤Ë¤·¡¢Moenyɽ¼¨¤Î¹¹¿·¤ò¹Ô¤¦¤è¤¦À߷פ·¤Þ¤¹¡£
¡¡¿·¤·¤¯ÊÑ¿ô¤ò£±¤ÄÍÑ°Õ¤·¡¢Àè¤Û¤ÉCanvas¤ËºîÀ®¤·¤¿¡¢Money¤Î¿ô»úɽ¼¨¤ò¹Ô¤¦ Text ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò»ý¤Ä txtMoney ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ðÊó¤ò¥¢¥µ¥¤¥ó½ÐÍè¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¥³¥ó¥Ý¡¼¥Í¥ó¥È¤È¥¹¥¯¥ê¥×¥È¤òɳ¤Å¤±¤·¡¢¥¹¥¯¥ê¥×¥È¤«¤éÍøÍѽÐÍè¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡¿·¤·¤¯UpdateDisplayMoney¥á¥½¥Ã¥É¤òÍÑ°Õ¤·¡¢¤³¤Î¥á¥½¥Ã¥ÉÆâ¤Ç²èÌ̤ÎMoneyɽ¼¨¤Î¹¹¿·¤ò¹Ô¤¤¤Þ¤¹¡£
UIManager.cs
¡¡UIManager¥¹¥¯¥ê¥×¥È¤Î½¤Àµ¤¬½ªÎ»¤·¤¿¤é¡¢UIManager¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¤Æ¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ò³Îǧ¤·¡¢¥¢¥µ¥¤¥ó¾ðÊó¤òÀßÄꤷ¤Þ¤¹¡£
¿·¤·¤¯Äɲä·¤¿ txtMoney ÊÑ¿ô¤Î¾ðÊó¤¬É½¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Àè¤Û¤É¤Î¼ê½ç¤ÇºîÀ®¤·¤¿¡¢Æ±Ì¾¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò¥Ò¥¨¥é¥ë¥¡¼¤«¤é¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥µ¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡
UIManager¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
![](https://image01.seesaawiki.jp/i/o/i-school-memo/HmlbC33OyY-s.png)
¡¡¥²¡¼¥àÃæ¤ÎMoney¤ò´ÉÍý(²Ã»»)¤¹¤ëµ¡Ç½¤È¡¢¥²¡¼¥à¥¯¥ê¥¢»þ¤ËGameData¥¯¥é¥¹¤Ë¤¢¤ë totalMoney ¤Ë³ÍÆÀ¤·¤¿ Money ¤ò²Ã»»¤¹¤ë½èÍý¤ò¸Æ¤Ó½Ð¤¹¤è¤¦¤Ë¤·¤Þ¤¹¡£
Á°¤Ë¤âµ½Ò¤·¤Þ¤·¤¿¤¬¡¢¤³¤ÎBattleManager¥¯¥é¥¹¤¬°ì»þŪ¤Ê´ÉÍý¤ò¡¢GameData¥¯¥é¥¹¤¬Money¤ÎÁí¿ô¤ò´ÉÍý¤¹¤ëÀ߷פˤʤäƤ¤¤Þ¤¹¡£
¡¡Money´ÉÍýÍѤ˿·¤·¤¯ÊÑ¿ô¤ò£±¤ÄÍÑ°Õ¤·¤Þ¤¹¡£¤Þ¤¿Start¥á¥½¥Ã¥É¡¢Initialize¥á¥½¥Ã¥É¡¢CheckRemainingEnemies¥á¥½¥Ã¥É¤ò½¤Àµ¤·¡¢Money´ØÏ¢¤Î½èÍý¤òÄɵ¤·¤Þ¤¹¡£
¡¡AddMoney¥á¥½¥Ã¥É¤ò¿·¤·¤¯Äɲ䷤ơ¢¤³¤Î¥á¥½¥Ã¥É¤Î°ú¿ô¤ËÅϤäƤ¤¿Ãͤò money ¤Ë²Ã»»¤·¤Æ¤¤¤¤Þ¤¹¡£º£²ó¤ÏŨ¤¬Ç˲õ¤µ¤ì¤¿»þ¤Ë¤³¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç
Ũ¤Î»ý¤Ä Money ʬ¤À¤±²Ã»»¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¤Þ¤¿¤³¤Î¥á¥½¥Ã¥ÉÆâ¤Ç UIManager¤ÎUpdateDisplayMoney¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¥²¡¼¥à²èÌ̾å¤ÎMoney¤Îɽ¼¨¤ò¹¹¿·¤µ¤»¤Þ¤¹¡£
BattleManager.cs
¡¡Money¤Î³ÍÆÀÊýË¡¤È¤·¤Æ¡¢Å¨¤¬Ç˲õ¤µ¤ì¤¿ºÝ¤Ë¼èÆÀ¤Ç¤¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¤½¤Î¤¿¤á¤Ë¤Ï¡¢Money¤òÀßÄꤹ¤ë¤¿¤á¤ÎÊÑ¿ô¤òÍÑ°Õ¤·¡¢Å¨¤Î»ý¤ÄMoney¤ÎÃͤòÀßÄê½ÐÍè¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¤Þ¤¿Ç˲õ¤µ¤ì¤¿¥¿¥¤¥ß¥ó¥°¤Ç¡¢BattleManager¥¯¥é¥¹¤Ë¤³¤ÎÃͤòÅϤ¹¤³¤È¤Ç¡¢Money¤ò³ÍÆÀ¤Ç¤¤ë¤è¤¦¤ÊÀ߷פˤ·¤Þ¤¹¡£
¡¡Prefabs¥Õ¥©¥ë¥À¤Ë¤¢¤ëEnemyBall¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¤Æ¡¢¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ÎºÇ¾åÃʤˤ¢¤ë Open Prefab ¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡ÊÔ½¸¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢EnemyBall¥¹¥¯¥ê¥×¥È¤ò³Îǧ¤·¡¢¿·¤·¤¯Äɲ䵤줿 Money ÊÑ¿ô¤ËÃͤòÀßÄꤷ¤Þ¤¹¡£Ç¤°Õ¤ÎÃͤÇÌäÂꤢ¤ê¤Þ¤»¤ó¡£
EnemyBall¡¡ÀßÄê
![](https://image01.seesaawiki.jp/i/o/i-school-memo/2p3xbvNm8r-s.png)
EnemyBall¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
![](https://image01.seesaawiki.jp/i/o/i-school-memo/vLrQ4ftIbM-s.png)
¡¡¤¹¤Ù¤Æ¤Î¼ê½ç¤¬´°Î»¤·¤Þ¤·¤¿¤Î¤Ç¡¢¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
Ũ¤òÇ˲õ¤·¤¿ºÝ¤ËDebug.Log¤Ë²Ã»»Ãͤ¬É½¼¨¤µ¤ì¡¢²èÌ̤ÎMoneyɽ¼¨¤â¹¹¿·¤µ¤ì¤ì¤ÐÀ®¸ù¤Ç¤¹¡£
Debug.Log
![](https://image02.seesaawiki.jp/i/o/i-school-memo/tjSk3kTBM_-s.png)
¸¡¾ÚÆ°²è¡¡¡Å¨¤òÇ˲õ¤¹¤ë¤ÈMoneyɽ¼¨¤¬²Ã»»¤µ¤ì¤Æ¹¹¿·
https://gyazo.com/824cb7e3fcee4ee23fafcb29e2d0e9ba
¸¡¾ÚÆ°²è¢¡¡¤¹¤Ù¤Æ¤ÎŨ¤òÇ˲õ¤¹¤ë¤È¥¯¥ê¥¢¤È¤Ê¤ê¡¢GameData¥¯¥é¥¹¤ÎtotalMoney¤ÎÃͤËmoney¤ÎÃͤ¬²Ã»»¤µ¤ì¤ë
https://gyazo.com/602efa4de0d20172e8e9422f423f3bf8
¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯