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

Ũ¤ÎƬ¾å¤ËHP¥²¡¼¥¸¤òɽ¼¨¤¹¤ë¤¿¤á¤ÎÀ߷פò¹Í¤¨¤ë

¡¡Å¨¤Ë¤Ä¤¤¤Æ¡¢ºÇ¸å¤ÎÀß·×¹àÌܤʤê¤Þ¤·¤¿¡£

¡¦Å¨¤ÎHP¤ÏŨ¤ÎƬ¾å¤Ë²£¥²¡¼¥¸É½¼¨¤·¡¢¸½ºßÃͤ¬¥°¥é¥Õ¥£¥«¥ë¤ËÅÁ¤¨¤é¤ì¤ë¤è¤¦¤Ë¥Ç¥¶¥¤¥ó¤¹¤ë¡£
¡¦¥²¡¼¥¸¤Ï±¦Ã¼¤¬HPºÇÂç¡¢º¸Ã¼¤¬HPºÇ¾®¤È¤¹¤ë¡£
¡¦¥²¡¼¥¸¤ÏŨ¤È°ì½ï¤Ë°ÜÆ°¤¹¤ë¡£

¡¡¥×¥ì¥¤¥ä¡¼¤¬¹¶·â¤·¤ÆŨ¤Ë¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿ºÝ¤Ë¡¢¤½¤Î¤Þ¤Þ¤Ç¤ÏŨ¤ÎHP¤¬¤É¤Î°Ì»Ä¤Ã¤Æ¤¤¤ë¤Î¤«¤ï¤«¤ê¤Þ¤»¤ó¡£
»Ä¤Ã¤Æ¤¤¤ëHP¤¬¤ï¤«¤é¤Ê¤¤¤È¡¢¥æ¡¼¥¶¡¼¤¬Å¨¤òÅݤ¹ºÝ¤ÎÍ¥Àè½ç°Ì¤ò¹Í¤¨¤¿¤ê¤Ç¤­¤Þ¤»¤ó¤Î¤Ç¡¢Å¨¤Î»Ä¤êHP¤¬¤ï¤«¤ë¤è¤¦¤ËHP¤òɽ¼¨¤¹¤ë¤è¤¦¤ËÀ߷פò¹Í¤¨¤Þ¤·¤ç¤¦¡£
¤¿¤À¤·¿ô»ú¤À¤±¤è¤ê¤â¡¢¥²¡¼¥¸¤Ç¤¢¤Ã¤¿Êý¤¬»Ä¤êHP¤¬ÅÁ¤ï¤ê¤ä¤¹¤¯¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢Å¨¤ÎƬ¾å¤ËHP¤Î¥²¡¼¥¸¡ÊHpBar¡Ë¤òɽ¼¨¤¹¤ë¤è¤¦¤Ë¹Í¤¨¤Æ¤¤¤­¤Þ¤·¤ç¤¦¡£

¡¡¤Þ¤¿É½¼¨¤·¤¿HpBar¤ÏŨ¤È°ì½ï¤Ë°ÜÆ°¤·¤Æ¤â¤é¤¤¤¿¤¤¤Î¤Ç¡¢¤½¤Î¤¿¤á¤Ë¤Ï¤É¤¦¤¹¤ì¤Ð¤è¤¤¤«¡¢¹Í¤¨¤Þ¤¹¡£
Éð´ï¤Î»þ¤ÈƱ¤¸¤Ç¡¢Å¨¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤ÆHpBar¤òÄɲ䷤Ƥ¢¤²¤ì¤Ð°ì½ï¤ËÄɽ¾¤·¤ÆÆ°¤¤¤Æ¤¯¤ì¤½¤¦¤Ç¤¹¡£
¤Þ¤¿UI¤Ë¤ÏSlider¤È¤¤¤¦ÉôÉʤ¬¤¢¤ê¡¢¤³¤Á¤é¤òBarɽ¼¨¤È¤·¤Æ¤½¤Î¤Þ¤Þ»È¤¨¤Þ¤¹¡£¤³¤Á¤é¤ò»È¤¦¤è¤¦¤ËÀ߷פ·¤Þ¤·¤ç¤¦¡£

Ũ¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤ËCanvas¤ÈSlider¤òÄɲ乤ë

https://gyazo.com/c834c0a34912a4b08254ab5af29f55e3

¡¡Å¨¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¡¢»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤ÆCanvas¤ò¿·¤·¤¯ºîÀ®¤·¤ÆÄɲä·¤Þ¤·¤ç¤¦¡£
¤½¤ÎCanvas¤Î»Ò¤È¤·¤ÆUIÉôÉʤǤ¢¤ëSlider¤òÄɲä·¤Þ¤¹¡£¤³¤ÎSlider¤òHpBar¤È¤·¤ÆÍøÍѤ·¤Þ¤¹¡£
¥Ò¥¨¥é¥ë¥­¡¼¾å¤Ï²¼µ­¤Î²èÁü¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤ÐÂç¾æÉפǤ¹¡£



Slider¤ÎÀßÄê¤òÊѹ¹¤¹¤ë

¡¡Slider¤Î»ÒÍ×ÁǤǤ¢¤ëHandle Slide Area¤Ï¡¢¥Þ¥¦¥¹¥É¥é¥Ã¥°¤ÇÃͤòÊѹ¹¤¹¤ë»þ¤Ë»ÈÍѤ¹¤ë¤â¤Î¤Ç¤¹¡£
º£²ó¤Ï»ÈÍѤ·¤Þ¤»¤ó¤Î¤Ç¡¢¥Ò¥¨¥é¥ë¥­¡¼¤ÇÁªÂò¤·¤Æºï½ü¤·¤Æ¤ª¤­¤Þ¤¹¡£

¡¡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¤ò°ÜÆ°¤µ¤»¤é¤ì¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
Canvas¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ÎÃ椫¤éCanvas¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò³Îǧ¤·¡¢¤½¤ÎÃæ¤ÎRenderMode¤òWorldSpace¤ËÊѹ¹¤·¤Þ¤·¤ç¤¦¡£
¤½¤·¤ÆRectTransform¤Î±¦¾å¤Î»õ¼Ö¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¤·¡¢Reset¤ò¤·¤Þ¤¹¡£
¤³¤ì¤ÇŨ¤Î°ÌÃÖ¤ËCanvas¤¬°ÜÆ°¤·¤Þ¤·¤¿¡£¤¢¤È¤ÏPosition.Y¤Î°ÌÃÖ¤ÈScale¡¢Width¡¢Height¤Î³ÆÃͤòÄ´À°¤·¡¢¾å¼ê¤¯Å¨¤ÎƬ¾å¤ËHpBar¤¬Íè¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£




¡¡¤Þ¤¿Canvas¤Î¤Þ¤Þ¤Ç¤¹¤È¤ï¤«¤ê¤Ë¤¯¤è¤¦¤Ç¤¢¤ì¤Ð¡¢Ì¾¾Î¤òHpBarInfo¤Î¤è¤¦¤Ë¡¢¼«Ê¬¤Ç¤ï¤«¤ê¤ä¤¹¤¤Ì¾Á°¤ËÊѹ¹¤·¤Æ¤ª¤­¤Þ¤·¤ç¤¦¡£

HPBar¤ÎUI¤ò¾ï¤Ë¥«¥á¥é¤ÎÀµÌ̤ò¸þ¤¯¤è¤¦¤Ë¤¹¤ë

¡¡º£¤Î¤Þ¤Þ¤À¤È¡¢Å¨¤¬²£¤ò¸þ¤¤¤¿ºÝ¤Ë¡¢HpBar¤â²£Êý¸þ¤ò¸þ¤¤¤Æ¤·¤Þ¤¦¤¿¤á¸«¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
UI¤Ï£²£Ä¤È¤·¤ÆÀßÄꤷ¤Æ¤¤¤Þ¤¹¤Î¤Ç¥«¥á¥é¤ÎÀµÌ̤ò¾ï¤Ë¸þ¤¤¤Æ¤¤¤Æ¤¯¤ì¤ì¤Ð¡¢¤³¤ÎÌäÂê¤Ï²ò¾Ã¤Ç¤­¤½¤¦¤Ç¤¹¡£

¡¡¿·¤·¤¤¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¡¢Ì¾Á°¤òHpBarInfo¤Ë¤·¤Þ¤¹¡£´°À®¤·¤¿¤éŨ¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤ÎCanvas¤Ë¥¢¥¿¥Ã¥Á¤·¤Þ¤¹¡£

<= ¡Ü¥Ü¥¿¥ó¤ò²¡¤¹¤È³«¤­¤Þ¤¹¤Î¤Ç¡¢¼«Ê¬¤Ê¤ê¤Î¼ÂÁõ¤ò¹Ô¤Ã¤¿¾å¤Ç³Îǧ¤ò¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£


Ũ¤ÎHP¤ÈHp¥Ð¡¼¤ò¥ê¥ó¥¯¤µ¤»¤ë¤¿¤á¤ÎÀ߷פò¹Í¤¨¤ë

¡¡Ìµ»ö¤ËHpBar¤òɽ¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤·¤¿¡£¤Ç¤¹¤¬¤³¤Î¤Þ¤Þ¤Ç¤Ï¡¢Á°²ó¤Îº÷ŨÈϰϤÈƱÍͤ˽èÍý¤¬ÆÈΩ¤·¤Þ¤Ã¤Æ¤ª¤ê¡¢
Ũ¤Î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¤òÈóɽ¼¨¤Ë¤¹¤ë½èÍý¤òÄɲä·¤Þ¤·¤ç¤¦¡£

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


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

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

Menu


´ðÁÃ

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

private



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

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