ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2020ǯ06·î30Æü(²Ð) 23:26:50ÍúÎò
¡¦Å¨¤ÎHP¤ÏŨ¤ÎƬ¾å¤Ë²£¥²¡¼¥¸É½¼¨¤·¡¢¸½ºßÃͤ¬¥°¥é¥Õ¥£¥«¥ë¤ËÅÁ¤¨¤é¤ì¤ë¤è¤¦¤Ë¥Ç¥¶¥¤¥ó¤¹¤ë¡£ ¡¦¥²¡¼¥¸¤Ï±¦Ã¼¤¬HPºÇÂç¡¢º¸Ã¼¤¬HPºÇ¾®¤È¤¹¤ë¡£ ¡¦¥²¡¼¥¸¤ÏŨ¤È°ì½ï¤Ë°ÜÆ°¤¹¤ë¡£
¡¡¥×¥ì¥¤¥ä¡¼¤¬¹¶·â¤·¤ÆŨ¤Ë¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿ºÝ¤Ë¡¢¤½¤Î¤Þ¤Þ¤Ç¤ÏŨ¤ÎHP¤¬¤É¤Î°Ì»Ä¤Ã¤Æ¤¤¤ë¤Î¤«¤ï¤«¤ê¤Þ¤»¤ó¡£
»Ä¤Ã¤Æ¤¤¤ëHP¤¬¤ï¤«¤é¤Ê¤¤¤È¡¢¥æ¡¼¥¶¡¼¤¬Å¨¤òÅݤ¹ºÝ¤ÎÍ¥Àè½ç°Ì¤ò¹Í¤¨¤¿¤ê¤Ç¤¤Þ¤»¤ó¤Î¤Ç¡¢Å¨¤Î»Ä¤êHP¤¬¤ï¤«¤ë¤è¤¦¤ËHP¤òɽ¼¨¤¹¤ë¤è¤¦¤ËÀ߷פò¹Í¤¨¤Þ¤·¤ç¤¦¡£
¤¿¤À¤·¿ô»ú¤À¤±¤è¤ê¤â¡¢¥²¡¼¥¸¤Ç¤¢¤Ã¤¿Êý¤¬»Ä¤êHP¤¬ÅÁ¤ï¤ê¤ä¤¹¤¯¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢Å¨¤ÎƬ¾å¤ËHP¤Î¥²¡¼¥¸¡ÊHpBar¡Ë¤òɽ¼¨¤¹¤ë¤è¤¦¤Ë¹Í¤¨¤Æ¤¤¤¤Þ¤·¤ç¤¦¡£
¡¡¤Þ¤¿É½¼¨¤·¤¿HpBar¤ÏŨ¤È°ì½ï¤Ë°ÜÆ°¤·¤Æ¤â¤é¤¤¤¿¤¤¤Î¤Ç¡¢¤½¤Î¤¿¤á¤Ë¤Ï¤É¤¦¤¹¤ì¤Ð¤è¤¤¤«¡¢¹Í¤¨¤Þ¤¹¡£
Éð´ï¤Î»þ¤ÈƱ¤¸¤Ç¡¢Å¨¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤ÆHpBar¤òÄɲ䷤Ƥ¢¤²¤ì¤Ð°ì½ï¤ËÄɽ¾¤·¤ÆÆ°¤¤¤Æ¤¯¤ì¤½¤¦¤Ç¤¹¡£
¤Þ¤¿UI¤Ë¤ÏSlider¤È¤¤¤¦ÉôÉʤ¬¤¢¤ê¡¢¤³¤Á¤é¤òBarɽ¼¨¤È¤·¤Æ¤½¤Î¤Þ¤Þ»È¤¨¤Þ¤¹¡£¤³¤Á¤é¤ò»È¤¦¤è¤¦¤ËÀ߷פ·¤Þ¤·¤ç¤¦¡£
¡¡Å¨¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¡¢»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤ÆCanvas¤ò¿·¤·¤¯ºîÀ®¤·¤ÆÄɲä·¤Þ¤·¤ç¤¦¡£
¤½¤ÎCanvas¤Î»Ò¤È¤·¤ÆUIÉôÉʤǤ¢¤ëSlider¤òÄɲä·¤Þ¤¹¡£¤³¤ÎSlider¤òHpBar¤È¤·¤ÆÍøÍѤ·¤Þ¤¹¡£
¥Ò¥¨¥é¥ë¥¡¼¾å¤Ï²¼µ¤Î²èÁü¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤ÐÂç¾æÉפǤ¹¡£
º£²ó¤Ï»ÈÍѤ·¤Þ¤»¤ó¤Î¤Ç¡¢¥Ò¥¨¥é¥ë¥¡¼¤ÇÁªÂò¤·¤Æºï½ü¤·¤Æ¤ª¤¤Þ¤¹¡£
¡¡Slider¤Î»ÒÍ×ÁǤÎRectTransform¤ò³Îǧ¤·¤Æ¤¤¤¡¢Fll Area¤ÈFill¤òReset¤·¡¢¤¹¤Ù¤Æ¤ÎÃͤò0¤Ë¤·¤Þ¤¹¡£
¤³¤¦¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢Slider¤Î°ìÈÖü¤Î°ÌÃÖ¤«¤éBar¤¬Æ°¤¯¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
(°ÊÁ°Æþ¤Ã¤Æ¤¤¤¿¿ô»ú¤ÏHandle¤òÍøÍѤ¹¤ëºÝ¤Î¿ô»ú¤Ç¤¹¤Î¤Ç¡¢¤³¤³¤Ç0¤Ë¤·¤Æ¤âÌäÂꤢ¤ê¤Þ¤»¤ó¡£)
¡¡¡¡Fill¤ÎImage¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ÎColor¤òÊѹ¹¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢HpBar¤ÎÆ°¤¯¥²¡¼¥¸¤Î¿§¤òÊѹ¹¤Ç¤¤Þ¤¹¡£
À֤ʤɤΤ狼¤ê¤ä¤¹¤¤¿§¤ËÊѹ¹¤·¤Æ¤ª¤¤Þ¤·¤ç¤¦¡£
Fill Area
Fill
BackGround
Slider-1
Slider-2
¡¡¤½¤³¤Ç¡¢Canvas¤ÎÀßÄê¤òÊѹ¹¤·¡¢¥²¡¼¥à²èÌÌÆâ¤ËCanvas¤ò°ÜÆ°¤µ¤»¤é¤ì¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
Canvas¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ÎÃ椫¤éCanvas¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò³Îǧ¤·¡¢¤½¤ÎÃæ¤ÎRenderMode¤òWorldSpace¤ËÊѹ¹¤·¤Þ¤·¤ç¤¦¡£
¤½¤·¤ÆRectTransform¤Î±¦¾å¤Î»õ¼Ö¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¡¢Reset¤ò¤·¤Þ¤¹¡£
¤³¤ì¤ÇŨ¤Î°ÌÃÖ¤ËCanvas¤¬°ÜÆ°¤·¤Þ¤·¤¿¡£¤¢¤È¤ÏPosition.Y¤Î°ÌÃÖ¤ÈScale¡¢Width¡¢Height¤Î³ÆÃͤòÄ´À°¤·¡¢¾å¼ê¤¯Å¨¤ÎƬ¾å¤ËHpBar¤¬Íè¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡¡¤Þ¤¿Canvas¤Î¤Þ¤Þ¤Ç¤¹¤È¤ï¤«¤ê¤Ë¤¯¤è¤¦¤Ç¤¢¤ì¤Ð¡¢Ì¾¾Î¤òHpBarInfo¤Î¤è¤¦¤Ë¡¢¼«Ê¬¤Ç¤ï¤«¤ê¤ä¤¹¤¤Ì¾Á°¤ËÊѹ¹¤·¤Æ¤ª¤¤Þ¤·¤ç¤¦¡£
UI¤Ï£²£Ä¤È¤·¤ÆÀßÄꤷ¤Æ¤¤¤Þ¤¹¤Î¤Ç¥«¥á¥é¤ÎÀµÌ̤ò¾ï¤Ë¸þ¤¤¤Æ¤¤¤Æ¤¯¤ì¤ì¤Ð¡¢¤³¤ÎÌäÂê¤Ï²ò¾Ã¤Ç¤¤½¤¦¤Ç¤¹¡£
¡¡¿·¤·¤¤¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¡¢Ì¾Á°¤òHpBarInfo¤Ë¤·¤Þ¤¹¡£´°À®¤·¤¿¤éŨ¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤ÎCanvas¤Ë¥¢¥¿¥Ã¥Á¤·¤Þ¤¹¡£
Ũ¤ÎHP¤¬¸º¾¯¤·¤Æ¤âHpBar¤¬°ì½ï¤Ë¸º¾¯¤·¤Þ¤»¤ó¡£HpBar¤ÈŨ¤ÎHP¤È¤ò¥ê¥ó¥¯¤µ¤»¤Æ¡¢¹¶·â¤ò¼õ¤±¤ÆHP¤¬¸º¾¯¤·¤¿¤é¡¢HpBar¤âÆ°¤¯¤è¤¦¤Ë¤·¤Þ¤·¤ç¤¦¡£
¡¡À߷פò¹Í¤¨¤Æ¤ß¤Þ¤¹¡£Å¨¤ÎHP¤Î¾ðÊó¤òHpBar¤ËÁ÷¤ë¤³¤È¤¬½ÐÍè¤ì¤Ð¡¢¤Á¤ã¤ó¤È¾ðÊ󤬥ê¥ó¥¯¤Ç¤¡¢HpBar¤¬Æ°¤¯¤è¤¦¤Ë½ÐÍ褽¤¦¤Ç¤¹¤Í¡£
¤ä¤êÊý¤È¤·¤Æ¤Ï¡¢EnemyControler¥¯¥é¥¹¤Ë¤ÆHpBar¤Î½èÍý¤ò¤¹¤ë¤Î¤«¡¢¤¢¤ë¤¤¤ÏÀè¤Û¤Éºî¤Ã¤¿HpBar¥¯¥é¥¹¤Ç½èÍý¤ò¹Ô¤¦¤è¤¦¤Ë¤¹¤ë¤Î¤«¡¢
¤É¤Á¤é¤ÎÊýË¡¤Ç¤âÂбþ¤Ç¤¤ë¤È»×¤¤¤Þ¤¹¡£
¡¡¤³¤³¤Ç¤ÏHpBarInfo¥¯¥é¥¹¤Ë¤ÆHpBar¤Î½èÍý¤ò¹Ô¤¦ÊýË¡¤ò¼ÂÁõ¤·¤Æ¤¤¤¤Þ¤¹¡£
¤Þ¤º¤ÏHpBarInfp¥¯¥é¥¹¤ò½¤Àµ¤·¤Æ¤¤¤¤Þ¤¹¡£
¡¡¤Ä¤Å¤¤¤ÆEnemyControler¥¯¥é¥¹¤â½¤Àµ¤·¤Þ¤¹¡£¤³¤Á¤é¤«¤éHpBarInfo¥¯¥é¥¹¤ËºîÀ®¤·¤¿¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢Hp¤ÈHpbar¤È¤ÎƱ´ü¤ò¹Ô¤¤¤Þ¤¹¡£
¤Þ¤¿Hp¤¬0¤Ë¤Ê¤Ã¤¿¾ì¹ç¤Ë¤ÏHpBar¤òÈóɽ¼¨¤Ë¤¹¤ë½èÍý¤âÄɲ䷤Ƥª¤¤Þ¤¹¡£
¡¡²¼µ¤Î¥¹¥¯¥ê¥×¥È¤ÏEnemyControler¥¯¥é¥¹¤òÈ´¿è¤·¤¿¤Ç¤¹¡£OnTriggerEnter¥á¥½¥Ã¥É¤Î³ºÅöÉôʬ¤ËÄɲä·¤Þ¤¹¡£
¡¡¤½¤ì¤Ç¤Ï¼ÂºÝ¤ËÆ°¤«¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£¥×¥ì¥¤¥ä¡¼¤Î¹¶·â¤ò¼õ¤±¤¿ºÝ¤Ë¡¢Å¨¤ÎHpBar¤¬¸º¾¯¤¹¤ì¤Ð½èÍý¤ÏÀ®¸ù¤Ç¤¹¡£
Ũ¤¬Åݤ줿¥¢¥Ë¥á½èÍý¤òÄɲ乤ë¾ì¹ç¤Ë¤Ï¡¢Ç˲õ¤µ¤ì¤ë¤Þ¤Ç»þ´Ö¤¬¤«¤«¤ê¤Þ¤¹¤Î¤Ç¡¢¤½¤ÎÁ°¤ËHpBar¤òÈóɽ¼¨¤Ë¤¹¤ë½èÍý¤òÄɲä·¤Þ¤·¤ç¤¦¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- Áí¹ç
¥³¥á¥ó¥È¤ò¤«¤¯