ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2021ǯ09·î28Æü(²Ð) 14:51:52ÍúÎò
¡¡²èÌÌÆâ¤Ë¥Ü¥¿¥ó¤òÇÛÃÖ¤·¡¢²¡¤¹¤¿¤Ó¤Ë¡¢¡ÚÅùÇÜ® => 1.5ÇÜ® => 2ÇÜ® => ÅùÇÜ®¡Û¤ÈÀÚ¤êÂؤï¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡ã¼ÂÁõÆ°²è¢¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡ã¿·¤·¤¯³Ø½¬¤¹¤ëÆâÍÆ¡ä
¡¡¡¦¥¿¥×¥ë·¿¤Ë¤è¤ë¼ÂÁõÎã ¡¡¡¦»°¹à±é»»»Ò¤È % ±é»»»Ò¤Ë¤è¤ë¼ÂÁõÎã
¡¡¥æ¡¼¥¶¥Ó¥ê¥Æ¥£¤ò¹Íθ¤·¡¢¥¹¥Æ¡¼¥¸¥·¡¼¥ó¤Ç¤Î¥×¥ì¥¤¥ä¡¼¤È¥¨¥Í¥ß¡¼¥·¥ó¥Ü¥ë¤Î°Üư®ÅÙ¤ÎÄ´Àᵡǽ¤ÎÀ߷פò¹Ô¤¤¤Þ¤¹¡£
¡¡Â¿¤¯¤Î¥²¡¼¥à¤ÇºÎÍѤµ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢¥²¡¼¥à²èÌ̾å¤Ë®ÅÙÊѹ¹ÍѤΥܥ¿¥ó¤òÍÑ°Õ¤·¡¢¤½¤ì¤ò²¡¤¹¤¿¤Ó¤Ë°Üư®ÅÙ¤¬ÊѤï¤ë¤è¤¦¤ËÀ߷פò¹Í¤¨¤Þ¤¹¡£
¡¡¤É¤Î¤è¤¦¤Ë¤¹¤ì¤Ð´ÉÍý¤¬²Äǽ¤Ë¤Ê¤ë¤Î¤«¡¢¥Ü¥¿¥ó¤ò²¡¤¹¤¿¤Ó¤Ë½èÍý¤òϢư¤µ¤»¤ë¤Ë¤Ï¤É¤¦¤¹¤ì¤Ð¤¤¤¤¤Î¤«¡¢¥í¥¸¥Ã¥¯¤ÎÁȤ߹ç¤ï¤»¤ò¹Í¤¨¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¡¡º£²ó¤Ï¡¢»Ä¤ê°ÜÆ°²ó¿ô(¥¹¥¿¥ß¥Ê²ó¿ô)¤Îɽ¼¨Éôʬ¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë Button ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤òÄɲ䷤ƥܥ¿¥ó²½¤·¤Æ¤¤¤Þ¤¹¡£
¤½¤Î¾ì¹ç¡¢Image ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Raycast Target ¤Ë¥Á¥§¥Ã¥¯¤òÆþ¤ì¤Æ¡¢²èÁü¤ò¥¯¥ê¥Ã¥¯¤ä¥¿¥Ã¥×¤¬´¶ÃΤǤ¤ë¾õÂ֤ˤ·¤Æ¤¯¤À¤µ¤¤¡£
¡¡¤â¤Á¤í¤ó¡¢¿·¤·¤¯¥Ü¥¿¥ó¤òºîÀ®¤·¤Æ¤âÇÛÃÖ¤·¤Æ¤â¤è¤¤¤Ç¤¹¡£
¼«Ê¬¤Î¹Í¤¨¤¿À߷פǼÂÁõ¤ò¹Ô¤¤¤Þ¤·¤ç¤¦¡£
¡¡²¼µ¤Î²èÁü¤Ï»²¹ÍÎã¤Ç¤¹
¥Ò¥¨¥é¥ë¥¡¼²èÁü
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
°Üư®ÅÙ¤ÎÀÚ¤êÂؤ¨Íѥܥ¿¥ó¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¡¢¸½ºß¤Î°Üư®Å٤ξõÂÖ¤ò¥¢¥¤¥³¥óɽ¼¨¤¹¤ë¤¿¤á¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤¹¤ë
¡¡°Üư®ÅÙ¤ÎÀÚ¤êÂؤ¨¤¬¹Ô¤¨¤ë¤È¤¤¤¦¤³¤È¤Ï¡¢¥æ¡¼¥¶¡¼¤ËÂФ·¤Æ¡¢¸½ºß¤Î°Üư®ÅÙ¤¬¤É¤Î¤è¤¦¤Ê¾õÂ֤Ǥ¢¤ë¤«¤òÄ󼨤¹¤ëɬÍפ¬¤¢¤ë¤È¤¤¤¦¤³¤È¤Ç¤â¤¢¤ê¤Þ¤¹¡£
¤½¤Î¤¿¤á¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¤Þ¤¹¡£
¡¡º£²ó¤Ï°Üư®ÅÙ¤ÎÀÚ¤êÂؤ¨Íѥܥ¿¥ó¤Î»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ Image ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò»ý¤Ä¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¤Æ¤¤¤Þ¤¹¡£
̾Á°¤Ï imgSpeedIcon ¤ËÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡RaycastTarget ¤Î¥¹¥¤¥Ã¥Á¤Ï˺¤ì¤º¤Ë¥ª¥Õ¤Ë¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£¥Ü¥¿¥ó¤ÎÈ¿±þ¤ò˸¤²¤ëÍ×°ø¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡²èÁü¤Ï¤Þ¤ÀÀßÄꤷ¤Æ¤¤¤Ê¤¯¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£¥µ¥¤¥º¤â¡¢¸åÄø½¤Àµ¤Ç¤¤Þ¤¹¤Î¤Ç¡¢Ìܰ¤Ȥ·¤ÆºîÀ®¤·¤Æ¤ª¤¤Þ¤·¤ç¤¦¡£
¥Ò¥¨¥é¥ë¥¡¼²èÁü
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡ÌµÎÁ¤Î¥¢¥¤¥³¥ó¡¦¥¤¥é¥¹¥È¥µ¥¤¥È¤ò³èÍѤ·¡¢°Üư®ÅÙ¤ÎÄ´À°ÍפΥ¢¥¤¥³¥ó²èÁü¤ò½àÈ÷¤·¤Þ¤¹¡£
¼«Ê¬¤Ç¹Í¤¨¤Æ¤¤¤ë®ÅÙ¤ÎÄ´À°¿ô¤Ë¹ç¤ï¤»¤Æ²èÁü¤ò½àÈ÷¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡¶µºà¤Î¾ì¹ç¤Ï¡¢ÅùÇÜ®(Ä̾ï)¡¢1.5ÇÜ®¡¢2ÇÜ®¤Î£³¤Ä¤Î®ÅÙ¤òÍøÍѤ¹¤ë¤Î¤Ç¡¢£³¤Ä¤Î¥¢¥¤¥³¥ó²èÁü¤ò½àÈ÷¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¤³¤Î²èÁü¤òÀè¤Û¤ÉºîÀ®¤·¤¿ imgSpeedIcon ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÉôʬ¤ËŬÍѤ¹¤ë·Á¤ÇÍøÍѤ·¤Þ¤¹¡£
¡¡¼ÂºÝ¤Ë²èÁü¤òÅö¤Æ¤Ï¤á¤Æ¤¤¤Ã¤Æ¡¢»Ä¤ê¤Î°ÜÆ°²ó¿ôɽ¼¨¤ò±£¤·¤Æ¤·¤Þ¤Ã¤Æ¤¤¤Ê¤¤¤«¡¢¥µ¥¤¥º¤¬¾®¤µ¤¹¤®¤Ê¤¤¤«¡¢µÕ¤ËÂ礤¹¤®¤Ê¤¤¤«¡¢¤Ê¤É¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
¥¹¥¯¥ê¥×¥È¤ò»È¤Ã¤Æ¥²¡¼¥à¼Â¹Ô»þ¤Ë²èÁü¤ò¼«Æ°Åª¤ËÆɤ߹þ¤à¤è¤¦¤Ë¤·¤Þ¤¹¤Î¤Ç¡¢Ä´À°¤¬½ªÎ»¤·¤¿¤é¡¢²èÁü¤ò¤Ê¤·¤Ë¤·¤Æ¤ª¤¤¤Æ¤â¤¤¤¤¤Ç¤¹¤·¡¢²¾¤Î²èÁü¤ò¤Ä¤±¤Æ¤ª¤¤¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£
¡¡²¼µ¤Î²èÁü¤ÏÍøÍÑÎã¤Ç¤¹¡£
¡ãÍøÍÑÎã¡¡Ä̾ï»þ(¥¹¥Æ¡¼¥¸³«»Ï»þ)¡ä
¡ãÍøÍÑÎã¡¡1.5ÇÜ®»þ¡ä
¡ãÍøÍÑÎã¡¡2ÇÜ®»þ¡ä
¡¡¿·¤·¤¯°Üư®ÅÙÄ´À°¤Î¿ôÃͤòÊÝ»ý¤¹¤ë¤¿¤á¤ÎÊÑ¿ô¤òÄɲä·¤Þ¤¹¡£
¤³¤ÎÃͤ¬¡¢°Üư®ÅÙÄ´À°¤Î¥Ü¥¿¥ó¤ò²¡¤¹¤¿¤Ó¤ËÊѹ¹¤µ¤ì¤Æ¡¢¥×¥ì¥¤¥ä¡¼¤È¥¨¥Í¥ß¡¼¤Î¥·¥ó¥Ü¥ë¤Î°Üư®ÅÙ¤ËÂФ·¤ÆÄ´À°ÃͤȤ·¤ÆŬÍѤµ¤ì¤ë¥í¥¸¥Ã¥¯¤Ç¤¹¡£
¡¡ InitialzeGameData ¥á¥½¥Ã¥É¤Ë¤â½èÍý¤òÄɲä·¡¢¤³¤ÎÃͤνé´üÃͤòÀßÄꤷ¤Æ¤¤¤Þ¤¹¡£
GameData.cs
¡¡°Üư®ÅÙ¤ÎÊѹ¹¥Ü¥¿¥ó¤ò²¡¤·¤¿ºÝ¤Î½èÍý¤ò¼ÂÁõ¤¹¤ë¤¿¤á¡¢¿·¤·¤¤¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤ÆÀ©¸æ¤ò¹Ô¤¤¤Þ¤¹¡£
¥Ü¥¿¥ó¤ò²¡¤¹¤¿¤Ó¤Ë¡¢°Üư®ÅÙ¤ÎÊѹ¹¤¬¹Ô¤ï¤ì¤Æ¡¢²èÌ̤ήÅ٤Υ¢¥¤¥³¥ó¤âÀÚ¤êÂؤï¤ë½èÍý¤¬É¬Íפˤʤê¤Þ¤¹¡£
¡¡¥Ý¥¤¥ó¥È¤Ï¡¢°Üư®ÅÙ¤ÎÀßÄê¤ò¹Ô¤¦¤À¤±¤Ç¡¢°Üư®Å٤μ¿ôÃͤϴÉÍý¤·¤Æ¤¤¤Ê¤¤¡¢¤È¤¤¤¦Éôʬ¤Ç¤¹¡£
¤³¤Î¥¹¥¯¥ê¥×¥ÈÆâ¤Ç¤Ï¡¢ÀÚ¤êÂؤ¨¤Î¤ß¹Ô¤¤¡¢GameData ¥¯¥é¥¹Æâ¤Ç´ÉÍý¤·¤Æ¤¤¤ëÊÑ¿ô¤òÍøÍѤ·¤Æ¡¢°Üư®ÅÙ¤ò¥²¡¼¥àÆâ¤ËÈ¿±Ç¤µ¤»¤Þ¤¹¡£
¡¡
¡¡¤³¤ì¤Ï¡¢¥×¥ì¥¤¥ä¡¼¤È³Æ¥¨¥Í¥ß¡¼¤Î¥·¥ó¥Ü¥ë¤¬¥¢¥¯¥»¥¹¤·¤ä¤¹¤¤¤¿¤á¤Ë¡¢GameData ¥¯¥é¥¹¤Ë°Üư®ÅÙ¤ÎÊÑ¿ô¤òÍÑ°Õ¤·¤Æ¤¤¤Þ¤¹¡£
¡¡ÂçÀڤʤ³¤È¤Ï¡¢Êѹ¹¤ò¹Ô¤¦¾ì½ê(¥¯¥é¥¹)¤ÈÊѹ¹¤ÎÆâÍƤò½èÍý¤¹¤ë¾ì½ê(¥¯¥é¥¹)¤òɬ¤º¤·¤âƱ¤¸¤Ë¤¹¤ëɬÍפϤʤ¤¡¢¤È¤¤¤¦¹Í¤¨Êý¤Ç¤¹¡£
¡¡MoveTimeScaleController ¥¯¥é¥¹¤Ç¤Ï°Üư®ÅÙ¤ÎÊѹ¹¤È¡¢¸½ºß¤Î°Üư®Å٤ξõÂÖ¤ò´ÉÍý¤·¤Æ¤¤¤Þ¤¹¤¬¡¢°Üư®Å٤οôÃͤϴÉÍý¤»¤º¡¢Ê̤Υ¯¥é¥¹¤Ë´ÉÍý¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¤³¤Î MoveTimeScaleController ¥¯¥é¥¹¤Ç¿ôÃͤξðÊó¤ò´ÉÍý¤·¤Æ¤¤¤ë¾ì¹ç¡¢¥×¥ì¥¤¥ä¡¼¤È¥¨¥Í¥ß¡¼¤Î¥¯¥é¥¹¤ËÂФ·¤Æ°Üư®ÅÙ¤òÄ󶡤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¤¬¡¢
MoveTimeScaleController ¥¯¥é¥¹¤Ï¥·¥ó¥°¥ë¥È¥ó¥¯¥é¥¹¤Ç¤Ï¤Ê¤¤¤¿¤á¡¢¤¤¤º¤ì¤Î¥¯¥é¥¹¤â¡¢°Üư®ÅÙ¤ò»²¾È¤¹¤ë¤¿¤á¤Ë¡¢»öÁ°¤Ë MoveTimeScaleController ¥¯¥é¥¹¤Î¾ðÊó¤Î¼èÆÀ¤¬É¬Íפˤʤê¤Þ¤¹¡£
¡¡¤Ç¤¹¤¬¡¢°Üư®Å٤ξõÂ֤Τߤò MoveTimeScaleController ¥¯¥é¥¹¤Ç´ÉÍý¤·¡¢¼ÂºÝ¤ËŬÍѤ¹¤ëÃͤò GameData ¥¯¥é¥¹¤Ç´ÉÍý¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¤É¤¦¤Ç¤·¤ç¤¦¤«¡£
GameData ¥¯¥é¥¹¤Ï¥·¥ó¥°¥ë¥È¥ó¥¯¥é¥¹¤Ç¤¹¤Î¤Ç¡¢¤¤¤º¤ì¤Î¥¯¥é¥¹¤«¤é¤Ç¤â»²¾È¤¬¤¹¤°¤Ë²Äǽ¤Ç¤¹¡£¤Ä¤Þ¤ê¡¢°Üư®Å٤ξõÂ֤ȿôÃͤȤò°ìËܲ½¤»¤º¤Ë¡¢¤¢¤¨¤Æʬ¤±¤Æ¤ª¤¤¤¿Êý¤¬¡¢º£²ó¤Î¾ì¹ç¤ÏÍøÊØÀ¤¬¹â¤¤¤³¤È¤¬Ê¬¤«¤ê¤Þ¤¹¡£
¡¡¹¤¤»ëÌî¤Ç¡¢¤É¤Î¥¯¥é¥¹¤ËÊÑ¿ô¤Î¾ðÊ󤬤¢¤ì¤Ð°ìÈÖºÇŬ¤Ê½èÍý¤¬¼ÂÁõ¤Ç¤¤ë¤Î¤«¤ò¥¤¥á¡¼¥¸¤·¤Ê¤¬¤é¥í¥¸¥Ã¥¯¤òºî¤Ã¤Æ¤¤¤¤Þ¤¹¡£
¡¡¤Ê¤ª¡¢¥¹¥¯¥ê¥×¥ÈÆâ¤Ë°ì½ï¤Ë MoveTimeScale ·¿¤Î enum ¤ÎÀë¸À¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£
¤³¤ì¤ÏÊÌ¥Õ¥¡¥¤¥ë¤Ë¤·¤ÆºîÀ®¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£
¡¡¤Þ¤¿¡¢¿·¤·¤¯¥¿¥×¥ë·¿¤òÍøÍѤ·¤¿Ìá¤êÃͤνèÍý¤È¡¢»°¹à±é»»»Ò¤È % ±é»»»Ò¤òÍøÍѤ·¤¿Ãͤνé´ü²½½èÍý¤ò¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹¡£
¤½¤Á¤é¤â°ì½ï¤Ë³Ø½¬¤ò¹Ô¤¤¤Þ¤·¤ç¤¦¡£
MoveTimeScaleController.cs
¡¡¥¿¥×¥ë(tuple)·¿¤Ï C# ¤Î»ý¤Äµ¡Ç½¤Î£±¤Ä¤Ç¤¹¡£Ê£¿ô¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Ç¡¼¥¿¤ò¤Ò¤È¤Þ¤È¤á¤Ë¤·¤Æ´ÉÍý¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¤Þ¤¿¡¢Ìá¤êÃͤȤ·¤ÆÍøÍѤ¹¤ë¾ì¹ç¤Ë¤Ï¡¢Ê£¿ô¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î¥Ç¡¼¥¿¤òƱ¤¸¤è¤¦¤Ë¤Þ¤È¤á¤ÆÌᤷ¤Æ¤¯¤ì¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡¥¿¥×¥ë·¿¤ÎÀë¸À¤Î½ñ¼°¤ÏÊ£¿ô¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤½¤ì¤¾¤ì¾Ò²ð¤·¤Þ¤¹¡£º£²ó¤Ï¢¤Î½ñ¼°¤Ç¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹¡£
¡¡
¡ãµ½ÒÎã¡¡ä
(int, bool) damage = (0, false); ¡¡(Sprite, MoveTimeScale) nextTimeScaleValue;
¡¡¾åµ¤ÎÎã¤Î¾ì¹ç¡¢damage ÊÑ¿ô¤ä nextTimeScaleValue ÊÑ¿ô¤Ë¤Ï¡¢£²¤Ä¤Î·¿¤Î¾ðÊ󤬴ޤޤì¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
¤è¤êÃúÇ«¤Ë½ñ¤¯¾ì¹ç¤Ë¤Ï¡¢º£²ó¤Î¤è¤¦¤Ë¡¢Ä̾ï¤ÎÊÑ¿ô¤Î¤è¤¦¤Ë·¿¤ËÂФ·¤ÆÀë¸À¤â²Äǽ¤Ç¤¹¡£
½ÐÍè¤ë¤À¤±¥¿¥×¥ëÆâ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Î·¿¤Ë¤âÊÑ¿ô¤ÎÀë¸À¤ò¤Ä¤±¤ÆÍøÍѤ¹¤ë¤³¤È¤ò¤ª¤¹¤¹¤á¤·¤Þ¤¹¡£
¡ãµ½ÒÎ㢡ä
(int value, bool isWeakness) = (0, false); ¡¡(Sprite nextSprite, MoveTimeScale nextMoveTimeScaleType);
¡ãµ½ÒÎ㣡ä
(int value, bool isWeakness) damage = (0, false); ¡¡(Sprite nextSprite, MoveTimeScale nextMoveTimeScaleType) nextTimeScaleValue;
¡¡¥¿¥×¥ë·¿¤Î¾ðÊó¤ò°·¤¦¾ì¹ç¡¢¥¿¥×¥ëÆâ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¤ÆÊÑ¿ô¤ÎÀë¸À¤ò¹Ô¤Ã¤Æ¤¤¤ë¤«¡¢¤¤¤Ê¤¤¤«¤Ë¤è¤Ã¤Æ¡¢»²¾È¤¹¤ë¾ì¹ç¤Îµ½Ò¤¬ÊѤï¤ê¤Þ¤¹¡£
¡¡µ½ÒÎ㡤Τ褦¤Ë¡¢¥¿¥×¥ëÆâ¤Ç·¿¤Î¤ß¤·¤«Àë¸À¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥¿¥×¥ëÆâ¤Î¾ðÊó¤Ï Item1¡¢Item2 ¤È¤¤¤¦¤è¤¦¤Ë¼«Æ°Åª¤ËºÎÈÖ¤µ¤ì¤Þ¤¹¡£
¤½¤Î¾ì¹ç¤Ï¡¢¡Ö¥¿¥×¥ë¤ÎÊÑ¿ô̾.¥¿¥×¥ëÆâ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀë¸À½ç¤ÎItem¤ÎÈÖ¹æ¡×¤Î½ñ¼°¤Çµ½Ò¤Ç¤¤Þ¤¹¡£
¡ãµ½ÒÎ㡤ξì¹ç¤Î»²¾ÈÎã¡ä
Hoge(damage.Item1); // int ·¿¤Î°ú¿ô¤ò»²¾È¤·¤ÆÅϤ·¤Æ¤¤¤Þ¤¹ Hpge(nextTimeScaleValue.Item2)
¡¡ÊÑ¿ô¤ÎÀë¸À¤ò¹Ô¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢Ä̾ï¤ÎÊÑ¿ô¤Î¤è¤¦¤Ë¡Ö¥¿¥×¥ë¤ÎÊÑ¿ô̾.¥¿¥×¥ëÆâ¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ÎÊÑ¿ô̾¡×¤Î½ñ¼°¤Çµ½Ò¤Ç¤¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢¥¿¥×¥ë¤ÎÊÑ¿ô̾¤«¤é¡¢Ãͤο䬤¬²Äǽ¤Ç¤¹¡£
¡ãµ½ÒÎ㢤ξì¹ç¤Î»²¾ÈÎã¡ä
Hoge(damage.value); // int ·¿¤Î°ú¿ô¤ò»²¾È¤·¤ÆÅϤ·¤Æ¤¤¤Þ¤¹ Hoge(nextTimeScaleValue.nextSprite); // Sprite ·¿¤Î°ú¿ô¤ò»²¾È¤·¤ÆÅϤ·¤Æ¤¤¤Þ¤¹
¡¡Item1¡¢Item2 ¤Ç¤â½èÍý¤ÏÆ°¤¤Þ¤¹¤¬¡¢¥×¥í¥°¥é¥à¤Ï½èÍý¤ò¸«¤Æ¡¢Ã¯¤Ç¤â¤¹¤°¤ËÆâÍƤ¬Íý²ò¤Ç¤¤ëÀ߷פ¬ÍýÁۤǤ¹¡£
¤Ê¤ë¤Ù¤¯ÊÑ¿ô̾¤ò¤Ä¤±¤Æ¥¿¥×¥ë¤ÎÀë¸À¤ò¤·¤¿Êý¤¬¤¤¤¤¤È¤¤¤¦¤Î¤Ï¡¢¤³¤Î¤è¤¦¤Ë¥×¥í¥°¥é¥à¤Î²ÄÆÉÀ¤Ë´Ø¤ï¤ë¤¿¤á¤Ç¤¹¡£
damage.Item1 ¤è¤ê¤â¡¢damage.value ¤ÎÊý¤¬¡¢ÊÑ¿ô̾¤À¤±¸«¤Æ¤â¤É¤Î¤è¤¦¤ÊÃͤ¬ÂåÆþ¤µ¤ì¤Æ¤¤¤ë¤«È½ÃǤ¬¤Ä¤¤ä¤¹¤¤¤Î¤Ç¡¢½èÍý¤òÆɤ߲ò¤¤ä¤¹¤¤¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
¡¡º£²ó¤Î¼ÂÁõ¤Ç¤Ï¡¢switch ʸ¤Ë¤è¤ëʬ´ô¤Î·ë²Ì¤ò¥¿¥×¥ë·¿¤ÎÊÑ¿ô¤ò½àÈ÷¤·¤Æ¤ª¤¯¤³¤È¤Ë¤è¤ê¡¢Ìá¤êÃͤξðÊó¤ò£²¤Ä¤Þ¤È¤á¤Æ¼õ¤±¼è¤ì¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¤³¤Î switch ʸ¤Ç¤Ï¡¢currentMoveTimeScale ÊÑ¿ô¤Î¾ðÊó¤òÀººº¤·¡¢¤½¤ÎÃͤ¬¤É¤Î case ¤Ë³ºÅö¤¹¤ë¤«¤òȽÄꤷ¤Æ¤¤¤Þ¤¹¡£
³ºÅö¤·¤¿ case Æâ¤Ë¤Ï¡¢Sprite ·¿¤È MoveTimeScale ·¿¤Î£²¤Ä¤Î¾ðÊó¤¬ÍÑ°Õ¤µ¤ì¤Æ¤ª¤ê¡¢¤½¤ì¤¬ nextTimeScaleValue ÊÑ¿ô¤ËÌá¤êÃͤȤ·¤ÆÌá¤Ã¤Æ¤¤Þ¤¹¡£
(Sprite nextSprite, MoveTimeScale nextMoveTimeScaleType) nextTimeScaleValue = currentMoveTimeScale switch { MoveTimeScale.Normal => (oneHalfSpeedIcon, MoveTimeScale.One_Half), MoveTimeScale.One_Half => (doubleSpeedIcon, MoveTimeScale.Double), MoveTimeScale.Double => (normalSpeedIcon, MoveTimeScale.Normal), _ => (normalSpeedIcon, MoveTimeScale.Normal) };
¡¡Î㤨¤Ð¡¢currentMoveTimeScale ÊÑ¿ô¤ÎÃͤ¬ MoveTimeScale.One_Half ¤Ç¤¢¤ë¤Ê¤é¤Ð¡¢¤½¤Î¹Ô¤Î½èÍý¤Ë³ºÅö¤¹¤ë¤¿¤á¡¢¤½¤ÎÃͤòŬÍѤ·¤Þ¤¹¡£
¤½¤Î¾ì¹ç¡¢Sprite ·¿¤Î doubleSpeedIcon ÊÑ¿ô¤È MoveTimeScale ·¿¤Î MoveTimeScale.Double ¤ÎÃͤ¬¤½¤ì¤¾¤ìŬÍѤµ¤ì¤Æ¡¢¤½¤ì¤¬Ìá¤êÃͤȤ·¤Æ nextTimeScaleValue ÊÑ¿ô¤ËÅϤµ¤ì¤Þ¤¹¡£
¡¡¤½¤Î¤¿¤á¡¢¤³¤Î½èÍý¤¬¼Â¹Ô¤µ¤ì¤ë¤È¡¢nextTimeScaleValue ÊÑ¿ôÆâ¤Î nextSprite ÊÑ¿ô¤Ë¤Ï doubleSpeedIcon ÃͤξðÊó¤¬ÂåÆþ¤µ¤ì¡¢
nextTimeScaleValue ÊÑ¿ôÆâ¤Î nextMoveTimeScaleType ÊÑ¿ô¤Ë¤Ï MoveTimeScale.Double ¤ÎÃͤ¬ÂåÆþ¤µ¤ì¤Æ¤¤¤ë¾õÂ֤ˤʤê¤Þ¤¹¡£
¡¡¤³¤Î¾ðÊó¤ò¤µ¤é¤ËÍøÍѤ¹¤ë¤³¤È¤Ç¡¢currentMoveTimeScale ÊÑ¿ô¤ÎÃͤ¬¹¹¿·¤µ¤ì¤Æ¡¢°Üư®Å٤ξõÂÖ¤¬Êѹ¹¤µ¤ì¡¢
¥¢¥¤¥³¥ó¤Î²èÁü¤Î¾ðÊó¤¬Êѹ¹¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
// MoveTimeScale ¤òÊѹ¹ currentMoveTimeScale = nextTimeScaleValue.nextMoveTimeScaleType; // ¥¢¥¤¥³¥ó²èÁü¤ÎÊѹ¹¤·¡¢¸½ºß¤Î MoveTimeScale ¤Ë¹ç¤ï¤»¤ë imgSpeedIcon.sprite = nextTimeScaleValue.nextSprite;
¡¡¤Ê¤ª¡¢¥¿¥×¥ë¤âÆþ¤ì»Ò¤òºî¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£Ä̾ï¤Ç¤¢¤ì¤Ð£²¤Ä¤Î·¿¤Ç¤¹¤¬¡¢¤³¤Îµ¡Ç½¤ò»È¤¨¤ÐÊ£¿ô¤Î¾ðÊó¤ò»ý¤¿¤»¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡ãÆþ¤ì»Ò¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥¿¥×¥ë¡ä
(int x, (string a, int b) y) tuple = (0, ("String", 100));
»²¹Í¥µ¥¤¥È
MicroSoft C#¥ê¥Õ¥¡¥ì¥ó¥¹
¥¿¥×¥ë·¿
https://docs.microsoft.com/ja-jp/dotnet/csharp/lan...
¡¡% ±é»»»Ò¤Ï¾ò·ï¼°¤ËÍøÍѤ¹¤ë¤ÈÊØÍø¤Ê½èÍý¤ò¼ÂÁõ¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
currentTimeScaleNo = currentTimeScaleNo % (int)MoveTimeScale.Count == 0 ? 0 : currentTimeScaleNo;
¡¡º£²ó¤Î¥±¡¼¥¹¤Ç¤Ï¡¢currentTimeScaleNo ÊÑ¿ô¤ÎÃͤò MoveTimeScale.Count Îóµó»Ò¤ò int ·¿¤Ë¥¥ã¥¹¥È¤·¤¿Ãͤǽü»»¤·¡¢¤½¤Î;¤ê¤ÎÃͤ¬ 0 ¤Ç¤¢¤ë¤«¤É¤¦¤«¤òɾ²Á¤·¤Æ¤¤¤Þ¤¹¡£
¡¡MoveTimeScale.Count Îóµó»Ò¤ò int ·¿¤Ë¥¥ã¥¹¥È¤·¤¿ºÝ¤ÎÃÍ¤Ï 3 ¤ÇÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¤³¤Á¤é¤Ï¾ï¤Ë 3 ¤Ë¤Ê¤ê¤Þ¤¹¡£
¤è¤Ã¤Æ¡¢currentTimeScaleNo ÊÑ¿ô¤ÎÃͤòËè²ó 3 ¤Ç½ü»»¤·¡¢¤½¤Î;¤ê¤ÎÃͤò³Îǧ¤¹¤ë½èÍý¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¤³¤Î½èÍý¤Î¥Ý¥¤¥ó¥È¤Ï¡¢³ä¤êÀÚ¤ì¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÃͤò¤½¤Î¤Þ¤ÞÍøÍѤ·¡¢³ä¤êÀڤ줿¾ì¹ç(;¤ê¤¬ 0)¤Ë¤Ï¡¢Ãͤò 0 ¤Ë¤·¤Æ½é´ü²½¤·¤Æ¤¤¤ë¤³¤È¤Ç¤¹¡£
¡¡¼ÂºÝ¤Ë¡¢¤É¤Î¤è¤¦¤Ê½èÍý¤¬Æ°¤¤¤Æ¤¤¤ë¤«¤ò¡¢¼Â¿ôÃͤòÂåÆþ¤·¤Ê¤¬¤é³Îǧ¤·¤Æ¤ß¤Þ¤¹¡£
currentTimeScaleNo = 0 ¤Î¾ì¹ç¡¡(0 % 3 == 0) ¤È¤Ê¤ê¡¢³ä¤êÀÚ¤ì¤Ê¤¤¤Î¤Ç¡¢false ¤Îɾ²Á¤È¤Ê¤ê¡¢Í¾¤ê¤¬¤½¤Î¤Þ¤ÞŬÍѤµ¤ì¤ë¡£¤è¤Ã¤Æ¡¢currentTimeScaleNo ¤Ï 0 ¤Î¤Þ¤Þ ¡¡currentTimeScaleNo = 1 ¤Î¾ì¹ç¡¡(1 % 3 == 0) ¤È¤Ê¤ê¡¢³ä¤êÀÚ¤ì¤Ê¤¤¤Î¤Ç¡¢false ¤Îɾ²Á¤È¤Ê¤ê¡¢Í¾¤ê¤¬¤½¤Î¤Þ¤ÞŬÍѤµ¤ì¤ë¡£¤è¤Ã¤Æ¡¢currentTimeScaleNo ¤Ï 1 ¤Î¤Þ¤Þ currentTimeScaleNo = 2 ¤Î¾ì¹ç¡¡(2 % 3 == 0) ¤È¤Ê¤ê¡¢³ä¤êÀÚ¤ì¤Ê¤¤¤Î¤Ç¡¢false ¤Îɾ²Á¤È¤Ê¤ê¡¢Í¾¤ê¤¬¤½¤Î¤Þ¤ÞŬÍѤµ¤ì¤ë¡£¤è¤Ã¤Æ¡¢currentTimeScaleNo ¤Ï 2 ¤Î¤Þ¤Þ currentTimeScaleNo = 3 ¤Î¾ì¹ç¡¡(3 % 3 == 0) ¤È¤Ê¤ê¡¢³ä¤êÀÚ¤ì¤ë¡£¤è¤Ã¤Æ true ¤Îɾ²Á¤È¤Ê¤ê¡¢currentTimeScaleNo ¤Ï 0 ¤Ë¤Ê¤ë¡£¼¡¤ÏºÇ½é¤Î½èÍý¤ËÌá¤ë
¡¡¤¤¤«¤¬¤Ç¤·¤ç¤¦¤«¡£
¡¡º£²ó¡¢currentTimeScaleNo ÊÑ¿ô¤Ï¡¢¥¤¥ó¥¯¥ê¥á¥ó¥È¤Î½èÍý¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë¤¿¤á¡¢ËÜÍè¤Ç¤¢¤ì¤Ð¡¢2 => 3¡¢3 => 4 ¤Î¤è¤¦¤Ë¡¢¿ô»ú¤¬¤É¤ó¤É¤ó¤ÈÁý¤¨¤Æ¤¤¤Ã¤Æ¤·¤Þ¤¦¤Ï¤º¤Ç¤¹¡£
¤Ç¤¹¤¬¡¢¤³¤Î»°¹à±é»»»Ò¤Ë % ±é»»»Ò¤Ë¤è¤ë;¤ê¤òɾ²Á¤·¤¿¾ò·ï¼°¤òÁȤ߹礻¤ë¤³¤È¤Ë¤è¤ê¡¢¼«Æ°Åª¤Ë¡¢currentTimeScaleNo ÊÑ¿ô¤ÎÃͤò 0 ¡Á 2 ¤Þ¤Ç¤ÎÃæ¤Ç¤°¤ë¤°¤ë²ó¤ë¤è¤¦¤Ë½èÍý¤¬Æ°¤¤¤Æ¤¤¤ë¤³¤È¤¬¤ï¤«¤ë¤È»×¤¤¤Þ¤¹¡£
¡¡¤¢¤Þ¤êÆëÀ÷¤ß¤Î¤Ê¤¤ % ±é»»»Ò¤Ç¤¹¤¬¡¢³èÍÑÊýË¡¤¬¿§¡¹¤È¤¢¤ê¤Þ¤¹(Éÿô¤Ê¤É)¤Î¤Ç¡¢¾å¼ê¤¯¥í¥¸¥Ã¥¯¤ËÁȤ߹ç¤ï¤»¤ëÊýË¡¤ò¹Í¤¨¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
Stage ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Ë MoveTimeScaleController ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¡¢MoveTimeScaleController ¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤·¤ÆÀßÄê¤ò¹Ô¤¦
¡¡Stage ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¾å¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤ò³«¤¡¢Create Empty ¤òÁªÂò¤·¤Þ¤¹¡£
Stage ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥ÈÆâ¤Ë»Ò¥ª¥Ö¥¸¥§¥¯¥È¤È¤·¤Æ¿·¤·¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ºîÀ®¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢Ì¾Á°¤ò MoveTimeScaleController ¤ËÊѹ¹¤·¤Þ¤¹¡£
¡¡Àè¤Û¤ÉºîÀ®¤·¤¿ MoveTimeScaleController ¥¹¥¯¥ê¥×¥È¤ò¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥¿¥Ã¥Á¤·¡¢³ÆÊÑ¿ô¤Ë¥¢¥µ¥¤¥ó¤ò¹Ô¤¤¤Þ¤¹¡£
¥Ò¥¨¥é¥ë¥¡¼²èÁü
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡¤³¤ì¤é£²¤Ä¤Î¥¹¥¯¥ê¥×¥È¤Ë¤Ï DOTween ¤Î¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ°ÜÆ°¤ò¹Ô¤Ã¤Æ¤¤¤ë½èÍý¤¬¤¢¤ê¤Þ¤¹¡£
¤½¤ÎÉôʬ¤Î¡¢°ÜÆ°¤Ë¤«¤«¤ëÉÿô¤ÎÉôʬ¤Ë¡¢GameData ¥¯¥é¥¹¤ËÍÑ°Õ¤·¤¿ MoveTimeScale ÊÑ¿ô¤ò»È¤¤¡¢°Üư®ÅÙ¤¬ÊѲ½¤¹¤ë¤è¤¦¤Ë½èÍý¤ò½¤Àµ¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡MoveTimeScale ÊÑ¿ô¤Ï 1.0f => 0.75f => 0.5f ¤ÈÊѲ½¤·¤Þ¤¹¤Î¤Ç¡¢¤½¤Î¤Þ¤Þ·¸¿ô¤È¤·¤ÆÍøÍѤ¹¤ì¤Ð¡¢°Üư®ÅÙ¤¬Â®¤¯¤Ê¤ë¤³¤È¤Ë¤Ä¤Ê¤¬¤ê¤Þ¤¹¡£
¡¡Ä©À路¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¡¡¥¹¥Æ¡¼¥¸¥·¡¼¥ó¤Ë¤ª¤¤¤Æ¡¢Æ°ºî¤ò³Îǧ¤·¤Þ¤¹¡£
²èÌ̤Υ¢¥¤¥³¥óɽ¼¨¤À¤±¤Ç¤Ï¤Ê¤¯¡¢ÆâÉô¥Ç¡¼¥¿¤â³Îǧ¤·¤¿¤¤¤Î¤Ç¡¢MoveTimeScaleController ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ä GameData ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡°Üư®ÅÙ¤ÎÀÚ¤êÂؤ¨¥Ü¥¿¥ó¤ò²¡¤¹¤¿¤Ó¤Ë¡¢MoveTimeScaleController ¤Î CurrentMoveTimeScale ¤ÎÃͤ¬ Normal => OneHalf => Double => Normal ¤Î¤è¤¦¤Ë¡¢½çÈÖ¤ËÀÚ¤êÂؤï¤ë¤«¤ß¤Æ¤¯¤À¤µ¤¤¡£
¤³¤Î¤È¤¤Ë¡¢°ì½ï¤Ë²èÌ̾å¤Î¥¢¥¤¥³¥óɽ¼¨¤âϢư¤·¤ÆÀÚ¤êÂؤï¤Ã¤Æ¤¤¤ì¤ÐÀ©¸æÀ®¸ù¤Ç¤¹¡£
¡¡GameData ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î MoveTimeScale ÊÑ¿ô¤ÎÃͤâ 1.0f => 0.75f => 0.5f => 1.0f ¤È½çÈÖ¤ËÀÚ¤êÂؤï¤Ã¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¤Î¤Ç¡¢¤½¤Á¤é¤â³Îǧ¤·¤Þ¤·¤ç¤¦¡£
¡¡¤½¤Î¸å¡¢¤½¤ÎÃͤ¬¼ÂºÝ¤Ë°Üư®ÅÙ¤ËŬÍѤµ¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤ë¤¿¤á¤Ë¡¢¥×¥ì¥¤¥ä¡¼¤ò°ÜÆ°¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£
¥×¥ì¥¤¥ä¡¼¤È¥¨¥Í¥ß¡¼¤Î¥·¥ó¥Ü¥ë¤Î°Üư®ÅÙ¤ÎξÊý¤¬Á᤯¤Ê¤ì¤ÐÀ©¸æÀ®¸ù¤Ç¤¹¡£
¡¡³Îǧ¤¹¤ë¾ì½ê¤¬Â¿¤¤¤Î¤Ç¡¢½çÈ֤ˣ±¤Ä¤º¤Ä¡¢¤æ¤Ã¤¯¤ê¤È¥Ç¥Ð¥Ã¥°¤ò¹Ô¤¤¤Þ¤·¤ç¤¦¡£
¡ã¼ÂÁõÆ°²è¡¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡ã¼ÂÁõÆ°²è¢¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯