ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2023ǯ08·î16Æü(¿å) 20:36:57ÍúÎò
¼ê½ç£±£´¡¡¡Ý¾ã³²Êª¤ÎÀßÃÖ¡¦°ÜÆ°¡Ý
£²£³¡¥¾ã³²ÊªÍѤÎŨ¤òÀßÃÖ¤¹¤ë £²£´¡¥¥¹¥¯¥ê¥×¥È¤ò»È¤Ã¤Æ¡¢Å¨¤ò¾å²¼¤Ë°ÜÆ°¤µ¤»¤ë
¡ã¼Â¹ÔÆ°²è¡¡¾å²¼°ÜÆ°¤·¤Ê¤¬¤é²èÌ̺¸Â¦¤Ø°ÜÆ°¤¹¤ë¡ä
https://gyazo.com/fe32fe621b42c0bc0e9eacfd770fda7f
¡¡¿·¤·¤¯³Ø½¬¤¹¤ëÆâÍƤϰʲ¼¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¦DOTween¤Îµ¡Ç½¤È¼ÂÁõÎã¡¡¡¡ÝDOMoveY¥á¥½¥Ã¥É¡¢SetEase¥á¥½¥Ã¥É¡¢SetLoops¥á¥½¥Ã¥É¡¢SetLink ¥á¥½¥Ã¥É¡Ý
¡¡¶õÃæ¾²°Ê³°¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¤Æ¡¢¥²¡¼¥àÆâ¤ËÅо줵¤»¤Þ¤·¤ç¤¦¡£
ºÇ½é¤Ë¥¤¥ó¥Ý¡¼¥È¤·¤¿¥¢¥»¥Ã¥È¤ÎÃæ¤Ë¤Ï¿§¡¹¤Ê²èÁü¤Î¥Ç¡¼¥¿¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤Þ¤º¤ÏºÇ½é¤ËŨÌò¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¤Þ¤¹¡£
¡¡¥¥ã¥é¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó¥¯¥ê¥Ã¥×¤òºîÀ®¤·¤¿¤È¤¤Î¼ê½ç¤ÈƱ¤¸¤è¤¦¤Ë¡¢Ê£¿ô¤Î²èÁü¤ò¤Þ¤È¤á¤ÆÁªÂò¤·¤Æ¡¢¥Ò¥¨¥é¥ë¥¡¼¤Ë¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Þ¤¹¡£
¤³¤¦¤¹¤ë¤³¤È¤Ç¾ï¤Ë¥¢¥Ë¥á¡¼¥·¥ç¥ó¤·¤Æ¤¤¤ëŨ¤òºîÀ®¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¥Õ¥¡¥¤¥ë¤Î¾ì½ê¡¡¥Õ¥¡¥¤¥ë¤Î¾ì½ê¡¡Assets/Sunnyland/artwork/Sprites/Enemies/eagle/eagle-attack-1.png ¤«¤é eagle-attack-4.png ¤Þ¤Ç¤Î£´¥Õ¥¡¥¤¥ë
ÁªÂò»þ¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡ÁªÂò¤·¤¿¥Õ¥¡¥¤¥ë¤ò¤½¤Î¤Þ¤Þ¥Ò¥¨¥é¥ë¥¡¼¤Ë¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Þ¤¹¡£
Àè¤Û¤É¤ÈƱ¤¸¤è¤¦¤Ë¡¢Ê£¿ô¤Î²èÁü¤ò¤Þ¤È¤á¤ÆÀßÃÖ¤·¤¿¤¿¤á¡¢²èÁü¤ò¥¢¥Ë¥á¡¼¥·¥ç¥ó¥¯¥ê¥Ã¥×¤È¤·¤ÆÊݸ¤¹¤ë¤¿¤á¤Î Create New Animation ¥¦¥¤¥ó¥É¥¦¤¬³«¤¤Þ¤¹¡£
Create New Animation ¥¦¥¤¥ó¥É¥¦
¡¡¥Õ¥¡¥¤¥ë̾¤ò eagle.anim ¤ËÊѹ¹¤·¤ÆÊݸ¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡¥Ò¥¨¥é¥ë¥¡¼¤Ë eagle-attack-1 ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£
¥Ò¥¨¥é¥ë¥¡¼²èÁü
Scene¥Ó¥å¡¼¤ÈGame¥Ó¥å¡¼²èÁü
¡¡ºîÀ®¤µ¤ì¤¿¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤Ï¥¢¥Ë¥á¡¼¥·¥ç¥ó¥¯¥ê¥Ã¥×¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ¡¢¥¢¥Ë¥á¡¼¥·¥ç¥ó¤¬ºÆÀ¸¤µ¤ì¤ë¤«³Îǧ¤·¤Þ¤¹¡£
¡ã¼Â¹ÔÆ°²è¡¡Å¨¤¬¥¢¥Ë¥á¡¼¥·¥ç¥ó¤¹¤ë¤«³Îǧ¤¹¤ë¡ä
https://gyazo.com/992d3a384c89ac0ecf59a9f5703f64e4
¡¡¥²¡¼¥à²èÌ̤䥥ã¥é¤ËÈæ¤Ù¤Æ Eagle ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬¾®¤µ¤¤¤¿¤á¡¢Transform ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Scale ¤ÎÃͤò¤¹¤Ù¤Æ (2.5, 2.5, 2.5) ¤ËÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£
SpriteRenderer ¥³¥ó¥Ý¡¼¥Í¥ó¥È ¤È Animator ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ÏºîÀ®¤ÈƱ»þ¤Ë¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢¤³¤Á¤é¤ÏÊѹ¹²Õ½ê¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü¡
Scene¥Ó¥å¡¼¤ÈGame¥Ó¥å¡¼²èÁü(Scale ¤ò2.5 ¤ËÊѹ¹¸å)
https://gyazo.com/a0ed52f03386edb82416677e2bb66220
¡¡¿·¤·¤¯¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò£²¤ÄÄɲä·¤Þ¤¹¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤Î°ìÈÖ²¼¤Ë¤¢¤ë Add Compnent ¥Ü¥¿¥ó¤ò²¡¤·¤Æ¡¢CapsuleCollider2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤È Rigidbody2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤òÄɲä·¤Þ¤¹¡£
¡¡CapsuleCollider2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î Edit Collider ¥Ü¥¿¥ó¤ò²¡¤·¤Æ¡¢Scene¥Ó¥å¡¼¤Ç²èÁü¤Ë¸«¹ç¤Ã¤¿Â礤µ¤Î¥³¥é¥¤¥À¡¼¤ËÄ´À°¤·¤Æ¤¯¤À¤µ¤¤¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü¢¡¡CapsuleCollider2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È
Scene¥Ó¥å¡¼¤Î¥³¥é¥¤¥À¡¼ÊÔ½¸²èÁü
¡¡Rigidbody2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î BodyType ¥×¥í¥Ñ¥Æ¥£¤ò Kinematic ¤ËÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£
¤Þ¤¿¡¢Constraints ¥×¥í¥Ñ¥Æ¥£¤Î Freeze Rotation ¤Î Z ¤Ë¥Á¥§¥Ã¥¯¤ò¤¤¤ì¤Æ¤¯¤À¤µ¤¤¡£
¡¡¤³¤ÎÀßÄê¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤´¼«Ê¬¤ÇÄ´¤Ù¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü£¡¡Rigidbody2D ¥³¥ó¥Ý¡¼¥Í¥ó¥È
¡¡°Ê¾å¤ÇÀßÄê¤Ï½ªÎ»¤Ç¤¹¡£
¡¡MoveSpeed ¤òÀßÄꤷ¤Þ¤·¤¿¤Î¤Ç¡¢¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ¤ß¤Þ¤·¤ç¤¦¡£
¶õÃæ¾²¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÈƱ¤¸ÃͤòÀßÄꤷ¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢²èÌ̤κ¸Â¦¤Ë¸þ¤«¤Ã¤Æ°ÜÆ°¤ò¤¹¤ì¤ÐÀ®¸ù¤Ç¤¹¡£
¡ã¼Â¹ÔÆ°²è¡¡Å¨¤¬²èÌ̤κ¸Â¦¤Ë°ÜÆ°¤¹¤ë¡ä
https://gyazo.com/28f5d23cae21a535e1803d373a02b855
¡¡Å¨Ìò¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÏÄ»¤Î²èÁü¤Ç¤¹¡£¤½¤Î¤Þ¤Þ¤Î°ÌÃÖ¤ÇÉâÍ·¤·¤Æ¤¤¤ë¤è¤ê¡¢¼ÂºÝ¤ÎÄ»¤Î¤è¤¦¤Ë±©¤Ð¤¿¤¤¤Æ¤¤¤ëÍͻҤòºÆ¸½¤·¤¿Êý¤¬
²èÁü¤Ë¤â¹ç¤Ã¤Æ¤¤¤Þ¤¹¤·¡¢Æ°¤¤¬¤¢¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥²¡¼¥àŪ¤Ë¤âÌÌÇò¤¯¤Ê¤ê¤Þ¤¹¡£
¡¡²èÌÌÆâ¤Î°ÜÆ°½èÍý¤Ï´°À®¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¿·¤·¤¯¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤Æ¡¢¾å²¼Êý¸þ¤Ø¤Î°ÜÆ°¤â²Ã¤¨¤Þ¤·¤ç¤¦¡£°ÜÆ°¤µ¤»¤ë½èÍý¤â¿§¡¹¤ÊÊýË¡¤¬¤¢¤ê¤Þ¤¹¤¬¡¢
º£²ó¤Ï¥¢¥»¥Ã¥È¤È¤·¤Æ¥¤¥ó¥Ý¡¼¥È¤·¤¿ DOTween ¤Îµ¡Ç½¤òÍøÍѤ·¤Æ°ÜÆ°¤Î½èÍý¤ò¼ÂÁõ¤·¤Þ¤¹¡£
¡¡Àë¸À¥Õ¥£¡¼¥ë¥É¤Ç¤Ï£²¤Ä¤ÎÊÑ¿ô¤òÀë¸À¤·¤Þ¤¹¡£¤³¤ÎÊÑ¿ô¤òÍøÍѤ·¤Æ¡¢¾å²¼¤Î°ÜÆ°¤Ë¤«¤«¤ë»þ´Ö¤È¡¢¤É¤Î°Ì¤Î¾å²¼Éý¤ò°ÜÆ°¤Ç¤¤ë¤«¤ÎÈϰϤòÀßÄꤷ¤Þ¤¹¡£
¡¡Start¥á¥½¥Ã¥É¤Ç¤ÏDOTween¤Ë¤è¤ëºÂɸ¤ÎÊѹ¹½èÍý¤ò¹Ô¤¤¡¢°ÜÆ°¤Î½èÍý¤È¤·¤Æ¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹¡£
º£²ó¤Î¥±¡¼¥¹¤Ç¤Ï¡¢DOTween¤Ë¤è¤ë½èÍý¤ò̵¸Â¥ë¡¼¥×¤µ¤»¤Æ¡¢¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬¤¢¤ë¸Â¤êŨ¤ò¾å²¼¤µ¤»¤ë¥í¥¸¥Ã¥¯¤Ç¤¹¡£
DOTween ¤Î½èÍý¤ÏÈóƱ´ü½èÍý¤È¸Æ¤Ð¤ì¤ë½èÍý¤Ç¤¢¤ê¡¢¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎµóÆ°¤È¤Ïɳ¤Å¤¤¤Æ¤¤¤Þ¤»¤ó¡£
¤½¤Î¤¿¤á¡¢Å¬Àڤʥ¿¥¤¥ß¥ó¥°¤Ç DOTween ¤Ë¤è¤ë̵¸Â¥ë¡¼¥×¤ò²ò½ü¤·¤Ê¤¤¤È¡¢¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬¤Ê¤¤¾õÂ֤ˤ⤫¤«¤ï¤é¤º
¥ë¡¼¥×¤µ¤»¤ë½èÍý¤Î¤ß¤¬»Ä¤Ã¤Æ¥¨¥é¡¼¤ò°ú¤µ¯¤³¤¹¸¶°ø¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¼ÂÁõÎã¤ò£²¤ÄÄ󼨤·¤Æ¤ª¤¤Þ¤¹¡£DOTween ¤Ë¤è¤ë¥ë¡¼¥×½èÍý¤Î½ªÎ»ÊýË¡¤¬°Û¤Ê¤ë¤À¤±¤ÇŨ¤ÎµóÆ°¼«ÂΤËÊѲ½¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¡¡ºÇ½é¤Î¼ÂÁõÎã¤Ç¤Ï¡¢DOTween ¤Î½èÍý¤òÊÑ¿ô¤ËÂåÆþ¤·¤Æ¤ª¤¤¤Æ¡¢¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ÇË´þ¤µ¤ì¤ë¥¿¥¤¥ß¥ó¥°¤Ç DOTween ¤Î½èÍý¤òÇË´þ¤¹¤ë½èÍý¤ò¼Â¹Ô¤¹¤ë¥Ñ¥¿¡¼¥ó¤Ç¤¹¡£
¡¡OnDestroy ¥á¥½¥Ã¥É¤Ï Unity ¤Î MonoBehaviour ¥¯¥é¥¹¤Î»ý¤Äµ¡Ç½¤Î£±¤Ä¤Ç¤¹¡£
¤³¤Î¥á¥½¥Ã¥É¤Ï¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬Ç˲õ¤µ¤ì¤¿¤È¤¤Ë¼«Æ°Åª¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¡¢¥³¡¼¥ë¥Ð¥Ã¥¯¤È¤¤¤¦¼ïÎà¤Î¥á¥½¥Ã¥É¤Ë¤Ê¤ê¤Þ¤¹¡£
¤³¤Î¥á¥½¥Ã¥É¤ÎÃæ¤Ç¥ë¡¼¥×½èÍý¤ò¹Ô¤Ã¤Æ¤¤¤ë DOTween ¤Î½èÍý¤òÇË´þ¤·¤Æ¤¤¤Þ¤¹¡£
¡¡°ìÅÙÌ¿Îá¤ò½Ð¤·¤ÆÆ°¤½Ð¤·¤¿ DOTween ¤Î½èÍý¤Ï¡¢¸å¤«¤é½¤Àµ(°ì»þÄä»ß¤·¤¿¤ê¡¢½ªÎ»¤·¤¿¤ê)½ÐÍè¤Þ¤»¤ó¡£
½¤Àµ¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï¡¢¼Â¹Ô¤Î¥¿¥¤¥ß¥ó¥°¤Ç Tween ·¿¡¢¤¢¤ë¤¤¤Ï Tweener ·¿¤ÎÊÑ¿ô¤ËÂåÆþ¤·¤Æ¤ª¤¡¢
¤³¤ÎÊÑ¿ô¤ò»È¤Ã¤Æ DOTween ¤ØºÆÅÙÌ¿Îá¤ò½Ð¤¹¤³¤È¤ÇÂбþ¤Ç¤¤Þ¤¹¡£
VerticalFloatingObject.cs¡¡¡
¡¡¤â¤¦£±¤Ä¤Î¼ÂÁõÎã¤ÎÊý¤Ï¡¢DOTween ¤Î½ªÎ»¤¹¤ë¥¿¥¤¥ß¥ó¥°¤ò¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇË´þ¤Î¥¿¥¤¥ß¥ó¥°¤ËɳÉÕ¤±¤·¤Æ¤ª¤¤Þ¤¹¡£
¤³¤ÎÊýË¡¤Î¾ì¹ç¤Ï¡¢DOTween ¤Î¼Â¹ÔÌ¿Îá¤ÎºÝ¤Ë SetLink ¥á¥½¥Ã¥É¤òÄɲä·¤ÆÂбþ¤·¤Æ¤¤¤Þ¤¹¡£
¤³¤Á¤é¤Î¾ì¹ç¤Ë¤Ï¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇË´þ¤ÈƱ»þ¤Ë DOTween ¤Î½èÍý¼«ÂΤâÄä»ß¤·¤Æ¤¯¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢Æ°¤¤À¤·¤¿ DOTween ¤ËÂФ·¤Æ¸å¤«¤é½èÍý¤ò¹Ô¤¦É¬Íפ¬¤Ê¤¤¤¿¤á¡¢ÊÑ¿ô¤Ø¤ÎÂåÆþ¤ÏÉÔÍפˤʤäƤ¤¤Þ¤¹¡£
VerticalFloatingObject.cs¡¡¢
¡ãDOTween¤Îµ¡Ç½¤È¼ÂÁõÎã¡¡¡¡ÝDOMoveY¥á¥½¥Ã¥É¡¢SetEase¥á¥½¥Ã¥É¡¢SetLoops¥á¥½¥Ã¥É¡¢SetLink ¥á¥½¥Ã¥É¡¢Kill ¥á¥½¥Ã¥É¡Ý¡ä
¡¡Å¨¤Î°ÜÆ°½èÍý¤ËÂФ·¤Æ¤Ï¡¢DOTween¤Ë¤è¤ëÊä´Ö½èÍý¤ò¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹¡£
DOTween ¤Î½èÍý¤Ï¥³¥ë¡¼¥Á¥ó¤Î½èÍý¤ÈƱ¤¸¤ÇÈóƱ´ü½èÍý¤È¸Æ¤Ð¤ì¤ë½èÍý¤Ç¤¹¡£
Ä̾ï¤Î½èÍý¤Ï¡¢£±¤Ä¤Î½èÍý¤¬½ªÎ»¤·¤Æ¤«¤é¼¡¤Î½èÍý¤Ë°Ü¹Ô¤·¤Þ¤¹¤¬¡¢
ÈóƱ´ü½èÍý¤Î¾ì¹ç¡¢¤½¤Î½èÍý¤Î½ªÎ»¤ò¥á¥¤¥ó¥¹¥ì¥Ã¥É¤ÏÂÔ¤Á¤Þ¤»¤ó¡£¤½¤Î¤¿¤á¡¢¼Â¹Ô¤À¤±¤·¤Æ¡¢¼¡¤Î½èÍý¤Ë°Ü¹Ô¤·¤Þ¤¹¡£
¡¡ÈóƱ´ü½èÍý¤Î¥¤¥á¡¼¥¸¤È¤·¤Æ¤Ï¡¢¥Þ¥ë¥Á¥¿¥¹¥¯¤Ê½èÍý¤Î¼Â¸½¤ò²Äǽ¤Ë¤¹¤ë¤³¤È¤Ç¤¢¤ê¡¢
¥á¥¤¥ó¤Î½èÍý¤È¤Ï°Û¤Ê¤ë¾ì½ê¤Ç¡¢¤½¤Î½èÍý¤À¤±¤¬»ØÄꤵ¤ì¤¿»þ´Ö¤Î´Ö¤À¤±½èÍý¤ò¹Ô¤¤¡¢¼«Æ°Åª¤Ë½èÍý¤ò½ªÎ»¤·¤Þ¤¹¡£
¡¡¥«¥Ã¥×¥é¡¼¥á¥ó¤ò¥¤¥á¡¼¥¸¤¹¤ë¤È¤ï¤«¤ê¤ä¤¹¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£
¤ªÅò¤òÆþ¤ì¤Æ¤ª¤±¤Ð¡¢²¿Ê¬¤«¤·¤¿¤éÄ´Íý¤¬½ª¤ï¤Ã¤Æ¿©¤Ù¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¤½¤Î´Ö¤Ï¡¢¤½¤Î¾ì¤ÇÂԤäƤ¤¤ëɬÍפϤʤ¯¡¢Â¾¤Îºî¶È¤ò¤·¤Æ¤¤¤Æ¤â¡¢»þ´Ö¤¬·Ð²á¤¹¤ì¤ÐÄ´Íý¤Ï¼«Æ°Åª¤Ë½ªÎ»¤·¤Þ¤¹¡£
¤³¤Î¡Ö¤ªÅò¤òÆþ¤ì¤ë¡×Éôʬ¤¬ÈóƱ´ü½èÍý¤Î¼Â¹ÔÌ¿Îá¤Ç¤¢¤ê¡¢°ìÅÙ¤ªÅò¤òÃí¤²¤Ð¡¢¤¢¤È¤ÏÄ´Íý¤ÎÊý¤Ç¼«Æ°Åª¤Ë·×¬¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç
¼«Ê¬¤¬¤½¤Î¾ì¤Ë¤·¤Æ»þ´Ö¤ò·×¬¤·¤Æ¤¤¤Ê¤¯¤Æ¤âÄ´Íý¤Ï½ªÎ»¤·¤Þ¤¹¡£
¡¡¤³¤Î½èÍý¤ò¥²¡¼¥àÆâ¤ÇƱ´üŪ¤Ë¹Ô¤Ã¤Æ¤·¤Þ¤¦¤È¡¢¤½¤Î¾ì¤Ç¥é¡¼¥á¥ó¤¬½ÐÍè¾å¤¬¤ë¤Þ¤Ç¡¢Â¾¤Î½èÍý¤òÄä»ß¤·¤ÆÂԤäƤ¤¤ëɬÍפ¬À¸¤Þ¤ì¤Þ¤¹¡£
¤½¤ì¤ÏÈó¸úΨ¤Ç¤¢¤ë¤¿¤á¡¢¥á¥¤¥ó¤Î½èÍý¤Ï»ß¤á¤º¤Ë¡¢¤ªÅò¤À¤±Ãí¤¤¤À¤é¤¢¤È¤Ï´ØÃΤ»¤º¡¢
¥é¡¼¥á¥ó¤ËÄ´Íý¤¬½ªÎ»¤¹¤ë¤Þ¤Ç½èÍý¤ò°ÑǤ¤·¤Æ¤·¤Þ¤¦¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¥Ð¥ë¡¼¥ó¤ÎÀ¸À®½èÍý¤â¥³¥ë¡¼¥Á¥ó¤òÍøÍѤ·¤¿ÈóƱ´ü½èÍý¤Ç¤¹¡£
¥Ð¥ë¡¼¥ó¤ÎÀ¸À®¤ò¹Ô¤Ã¤Æ¤¤¤ëºÝ¡¢¥²¡¼¥à¤ÏÄä»ß¤·¤Æ¤¤¤Þ¤¹¤Ç¤·¤ç¤¦¤«¡©
Æ°ºî¤ò»×¤¤½Ð¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¡¡ÈóƱ´ü½èÍý¤Ë¤è¤Ã¤Æ¥Ð¥ë¡¼¥ó¤ÎÀ¸À®¤ò¹Ô¤Ã¤Æ¤¤¤ë¤Î¤Ç¡¢¥¥ã¥é¤Ï¼«Í³¤Ë°ÜÆ°¤Ç¤¤Æ¤¤¤ë¤È»×¤¤¤Þ¤¹¡£
¤³¤Î½èÍý¤â¡¢¥Ð¥ë¡¼¥ó¤ÎÀ¸À®Éôʬ¤ÎÌ¿Îá¤À¤±¹Ô¤¤¡¢¤¢¤È¤Ï¥Ð¥ë¡¼¥ó¤òÀ¸À®¤¹¤ë¥á¥½¥Ã¥ÉÆâ¤Î½èÍý¤¬Æȼ«¤Î¥¿¥¤¥ß¥ó¥°¤ÇÆ°¤Æ¤¤¤ë¤¿¤á¡¢
¥²¡¼¥à¤Î½èÍý¼«ÂΤòÁ˳²¤»¤º¤Ë¥Þ¥ë¥Á¥¿¥¹¥¯Åª¤Ê½èÍý¤¬¼ÂÁõ½ÐÍè¤Æ¤¤¤Þ¤¹¡£
¡¡¥¹¥¯¥ê¥×¥ÈÆâ¤ÇDOTween¤Î½èÍý¤ò¼ÂÁõ¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ºÇ½é¤Ë using ¤Ë¤è¤ëÀë¸À¤¬É¬Íפˤʤê¤Þ¤¹¡£
using UnityEngine; using System.Collections; using System.Collections.Generic; using DG.Tweening; // <=¡¡Äɲä·¤Þ¤¹
¡¡¤³¤Î¥¹¥¯¥ê¥×¥ÈÆâ¤Ç¤Ï£µ¤Ä¤Î¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢½çÈÖ¤ËÀâÌÀ¤·¤Æ¤¤¤¤Þ¤¹¡£
tweener = transform.DOMoveY(transform.position.y - moveRange, moveTime).SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
transform.DOMoveY(transform.position.y - moveRange, moveTime).SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo).SetLink(gameObject);
¡¡¤³¤ì¤é¤ÏÊ£¿ô¤Î¥á¥½¥Ã¥É¤¬¤Ä¤Ê¤¬¤Ã¤Æ£±¤Ä¤Î½èÍý¤ò·ÁÀ®¤·¤Æ¤¤¤Þ¤¹¡£¤½¤Î¾ì¹ç¡¢¥Ô¥ê¥ª¥É¤Î°ÌÃ֤Dzþ¹Ô¤·¤Æ¤ª¤¯¤³¤È¤Ç½èÍý¤¬Æɤߤ䤹¤¯¤Ê¤ê¤Þ¤¹¡£
²þ¹Ô¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢¥¤¥ó¥Ç¥ó¥È¤ò£±ÃÊÍîʬ¤º¤é¤·¤ÆµºÜ¤·¤Þ¤¹¡££±¤Ä¤Î½èÍýÆâ¤ËÊ£¿ô¤Î²þ¹Ô¤ò¹Ô¤¦¾ì¹ç¤Ë¤Ï¡¢£²¤ÄÌܰʹߤÏƱ¤¸¥¤¥ó¥Ç¥ó¥È¤Ë·¤¨¤Þ¤¹¡£
¡¡// DOTween ¤Ë¤è¤ëÌ¿Îá¤ò¼Â¹Ô¤·¡¢SetLink ¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇË´þ¤Ë Tween ¤Î½ªÎ»¤òɳÉÕ¤±¤¹¤ë transform.DOMoveY(transform.position.y - moveRange, moveTime) ¡¡¡¡¡¡.SetEase(Ease.Linear) ¡¡¡¡¡¡.SetLoops(-1, LoopType.Yoyo) ¡¡¡¡¡¡.SetLink(gameObject);
¡¡¤³¤Î¤è¤¦¤Ëµ½Ò¤¹¤ë¤³¤È¤Ç¡¢£±¹Ôʬ¤Î¼Â¹ÔÌ¿Îá¤Ï¡¢¹ç·×¤Ç£´¤Ä¥á¥½¥Ã¥É¤¬¤Ä¤Ê¤¬¤Ã¤Æ¹½À®¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ò¤ï¤«¤ê¤ä¤¹¤¯¤Ç¤¤Þ¤¹¡£
¡¡DOMoveY¥á¥½¥Ã¥É¤Ï¡¢¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î°ÌÃ֤Τ¦¤Á¡¢Y¼´(transform.position.y)¤À¤±¤ò»ØÄꤷ¤Æ°ÜÆ°¤µ¤»¤ë½èÍý¤Ç¤¹¡£
°ÜÆ°»þ¤ËÊä´Ö½èÍý¤ò¹Ô¤¦¤³¤È¤Ç¥¢¥Ë¥á¡¼¥·¥ç¥ó¤·¤Æ¤¤¤ë¤è¤¦¤Ë¸«¤»¤Æ¤¯¤ì¤Þ¤¹¡£
DOTween ¤Ë¤Ï¼ç(¥á¥¤¥ó)¤È¤Ê¤ë¼Â¹ÔÌ¿Îá¤ò»ý¤Ä¥á¥½¥Ã¥É¤¬¤¢¤ê¡¢¤½¤ì¤é¤Ï¤¹¤Ù¤Æ DO ¤Ç¥á¥½¥Ã¥É̾¤¬»Ï¤Þ¤ëµ¬Â§¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
¡¡DOMoveY ¥á¥½¥Ã¥É¤â DO ¤Ç¥á¥½¥Ã¥É̾¤¬»Ï¤Þ¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¼ç¤È¤Ê¤ë¥á¥½¥Ã¥É¤Î£±¤Ä¤Ç¤¹¡£
transform.DOMoveY(transform.position.y - moveRange, moveTime)
¡¡¤³¤Î¥á¥½¥Ã¥É¤Ï½èÍý¤ò¹Ô¤¤¤¿¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¡¢transfrom¤ËÂФ·¤Æ¼Â¹Ô¤·¤Þ¤¹¡£¤³¤³¤Ç¤Ï¤³¤Î¥¹¥¯¥ê¥×¥È¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò°ÜÆ°¤µ¤»¤ëÌ¿Îá¤ò¹Ô¤¤¤¿¤¤¤Î¤Ç
¤³¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎTransform ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤¬ÂåÆþ¤µ¤ì¤Æ¤¤¤ë transform ÊÑ¿ô¤ËÂФ·¤Æ½èÍý¤ò¹Ô¤¦¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
¡¡transform.DOMoveY()¤ÎÂ裱°ú¿ô¤Ïfloat·¿¤Ç¡¢°ÜÆ°¤µ¤»¤ë°ÌÃÖ¤ò»ØÄꤷ¤Þ¤¹¡£
º£²ó¤Ï¥²¡¼¥à²èÌÌÆâ¤Î¾å²¼¤Ë°ÜÆ°¤·¤¿¤¤¤Î¤Ç transform.position.y - moveRange ¤ò»ØÄꤷ¤Æ¤¤¤Þ¤¹¡£
¤³¤ì¤Ï¡¢¸½ºß¤Î transform.position.y ¤ÎÃͤ«¤é¡¢ moveRange ÊÑ¿ô¤ÎÃͤò°ú¤¤¤¿·×»»·ë²Ì¤ÎÃͤò°ÜÆ°¤µ¤»¤ë°ÌÃ֤Ȥ·¤Æ»ØÄꤷ¤Æ¤¤¤Þ¤¹¡£
¡¡Â裲°ú¿ô¤Ïfloat·¿¤Ç¡¢°ÜÆ°¤¹¤ëºÝ¤Ë¤«¤«¤ë»þ´Ö¤ò»ØÄꤷ¤Þ¤¹¡£º£²ó¤Ï moveTime ÊÑ¿ô¤ò»ØÄꤷ¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤ÎÊÑ¿ô¤ÎÃÍ É䫤±¤Æ
¤³¤Î¥¹¥¯¥ê¥×¥È¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎY¤Î°ÌÃÖ¤ò transform.position.y - moveRange ¤Î°ÌÃ֤ޤǰÜÆ°¤ò¤µ¤»¤ë¡¢¤È¤¤¤¦Ì¿Îá¤Ë¤Ê¤ê¤Þ¤¹¡£
£²¡Á£´¤Þ¤Ç¤ËÀâÌÀ¤·¤Æ¤¤¤ë³Æ¥á¥½¥Ã¥É¤Ï¡¢DOTween ¤Î¼ç¤È¤Ê¤ë¼Â¹Ô¥á¥½¥Ã¥É¤ËÉտ路¤ÆµºÜ¤Ç¤¤ë¥á¥½¥Ã¥É¤Ç¤¹¡£
ÉÔ¿ï¤Ç¤¤ë¥á¥½¥Ã¥É¤Ï Set ¤Ç¥á¥½¥Ã¥É̾¤¬»Ï¤á¤ëµ¬Â§¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
¡¡SetEase¥á¥½¥Ã¥É¤Ï¡¢DOTween¤Î DO¡Á ¤Ç»Ï¤Þ¤ë¼ç¥á¥½¥Ã¥É¤ËÉտ魯¤ë½èÍý¤Ç¤¹¡£
transform.DOMoveY(transform.position.y - moveRange, moveTime) ¡¡¡¡¡¡.SetEase(Ease.Linear)
¡¡¤³¤Î¤è¤¦¤ËDOTween¤Ç¤ÏDOTween¤Î¥á¥½¥Ã¥ÉƱ»Î¤ò£±¤Ä¤Î½èÍý¤Î²ô¤È¤·¤Æ³¤±¤Æ½èÍý¤ò¹Ô¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
½èÍý¤ò³¤±¤ë¾ì¹ç¤Ë¤Ï¡¢Á°¤Î¥á¥½¥Ã¥É¤Î¸å¤Ë¥Ô¥ê¥ª¥É(¥É¥Ã¥È)¤ò½ñ¤¯¤³¤È¤Ç¡¢¼¡¤Î¥á¥½¥Ã¥É¤ò½ñ¤¯¤³¤È¤¬²Äǽ¤Ç¤¹¡£¤³¤¦¤¤¤Ã¤¿½èÍý¤ò¥á¥½¥Ã¥É¥Á¥§¡¼¥ó¤È¤¤¤¤¤Þ¤¹¡£
¡¡SetEase¥á¥½¥Ã¥É¤Ç¤ÏEase¤È¤¤¤¦¥¢¥Ë¥á¡¼¥·¥ç¥ó¤µ¤»¤ëºÝ¤Î¥Ñ¥¿¡¼¥ó¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£Ease¤Ïenum·¿¤ÇÀßÄꤵ¤ì¤Æ¤ª¤ê¡¢Ease.¥¿¥¤¥× ¤Î½ñ¼°¤Çµ½Ò¤·¤Þ¤¹¡£
Èó¾ï¤Ë¿¤¯¤Î¼ïÎब¤¢¤ê¤Þ¤¹¡£º£²ó¤ÏºÇ¤â°ìÈÌŪ¤Ï Ease.Linear ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£Linear ¤ò»ØÄꤹ¤ë¤ÈÅù®¤Î¥¢¥Ë¥á¡¼¥·¥ç¥ó(Æ°¤»Ï¤á¤«¤é½ª¤ï¤ë¤Þ¤ÇƱ¤¸Â®ÅÙ¤ÇÆ°¤¯)¤¬¼ÂÁõ¤µ¤ì¤Þ¤¹¡£
¡¡
¡¡SetLoops¥á¥½¥Ã¥É¤Ï¡¢DOTween¤Î DO¡Á ¤Ç»Ï¤Þ¤ë¼ç¥á¥½¥Ã¥É¤ËÉտ路¤Æµ½Ò¤Ç¤¤ë¥á¥½¥Ã¥É¤Ç¤¹¡£¤³¤ÎÌ¿ÎáñÂΤǼ¹Ԥ¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£
transform.DOMoveY(transform.position.y - moveRange, moveTime) ¡¡¡¡¡¡.SetEase(Ease.Linear) ¡¡¡¡¡¡.SetLoops(-1, LoopType.Yoyo)
¡¡°ì½ï¤ËÌ¿Îá¤ò¤·¤Æ¤¤¤ë¼ç¤È¤Ê¤ë¥á¥½¥Ã¥É¤ËÂФ·¤Æ¥ë¡¼¥×½èÍý¤òÉÕÍ¿¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
º£²ó¤Î½èÍý¤Ç¤Ï¡¢transform.DOMoveY¥á¥½¥Ã¥É¤ËÂФ·¤Æ¡¢¥ë¡¼¥×½èÍý¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£(SetEase¥á¥½¥Ã¥É¤âSetLoops¥á¥½¥Ã¥É¤ÈƱ¤¸¤ÇñÂΤǤÏÆ°¤«¤Ê¤¤¥á¥½¥Ã¥É¤Ç¤¹)
¡¡Âè1°ú¿ô¤Ï¥ë¡¼¥×½èÍý¤ò¹Ô¤¦²ó¿ô¤Ç¤¹¡£int·¿¤ÇÀßÄꤷ¤Þ¤¹¡£º£²ó¤Î¤è¤¦¤Ë -1 ¤ò»ØÄꤹ¤ë¤È¡¢¤½¤ì¤Ï̵¸Â¥ë¡¼¥×¤Ë¤Ê¤ê¤Þ¤¹¡£(¥ë¡¼¥×¤¬½ªÎ»¤·¤Þ¤»¤ó)
¤³¤Î¤è¤¦¤Ê¾ì¹ç¤ÏÌÀ¼¨Åª¤Ë½èÍý¤òÄä»ß¤µ¤»¤Ê¤¤¤È̵¸Â¤Ë¥ë¡¼¥×¤ò·«¤êÊÖ¤·¤Þ¤¹¡£
¡¡Âè2°ú¿ô¤Ç¤Ï¥ë¡¼¥×¤µ¤»¤ë¥¿¥¤¥×¤òLoopType¤È¤¤¤¦enum·¿¤«¤éÁªÂò¤·¤Þ¤¹¡£LoopType.Yoyo ¤Î¾ì¹ç¤Ï¡¢A => B , B => A ¤È¤¤¤¦·Á¼°¤Ç¥ë¡¼¥×¤ò·«¤êÊÖ¤·¤Þ¤¹¡£(¥è¡¼¥è¡¼¤ÈƱ¤¸Æ°¤¤Ç¤¹)
¾¤Ë¤âLoopType¤¬¤¢¤ê¤Þ¤¹¤Î¤ÇÄ´¤Ù¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î½èÍý¤Ë¤è¤Ã¤Æ¡¢ºÇ½é¤Ï²¼Êý¸þ¤Ø°ÜÆ°¤·¡¢¤½¤Î¸å¡¢¸µ¤Î°ÌÃÖ¤ËÌá¤ë½èÍý¤¬¹Ô¤ï¤ì¤Þ¤¹¡£¤½¤ì¤ò̵¸Â¤Ë¥ë¡¼¥×¤·¤Þ¤¹¡£
¡¡ÀâÌÀ¤ÎËÁƬ¤Ë¤â½ñ¤¤¤¿¤è¤¦¤Ë¡¢DOTween ¤Î½èÍý¤Ï»ØÄꤵ¤ì¤¿»þ´Ö¤À¤±½èÍý¤¬Æ°¤¡¢¤½¤Î»þ´Ö·Ð²á¸å¤Ë¤Ï¼«Æ°Åª¤Ë½ªÎ»¤·¤Þ¤¹¡£
¤¿¤À¤·¡¢Ìµ¸Â¥ë¡¼¥×¤Î¾ì¹ç¡¢½èÍý¤ò½ªÎ»¤¹¤ë»þ´Ö¤¬ÌÀµ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¤Î¤Ç¡¢DOTween ¤Ë¤è¤Ã¤ÆÆ°¤¤¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ÇË´þ¤µ¤ì¤Æ¤â DOTween ¤Î½èÍý¤Ï¼«Æ°Åª¤Ë¤Ï½ªÎ»¤·¤Þ¤»¤ó¡£¤½¤Î¤¿¤á¡¢¥Ð¥°¤Î²¹¾²¤Ë¤Ê¤ê¤ä¤¹¤¯¡¢·Ù¹ð¤¬È¯À¸¤·¤Þ¤¹¡£
¡¡SetLink ¥á¥½¥Ã¥É¤Ï¡¢DOTween¤Î DO¡Á ¤Ç»Ï¤Þ¤ë¼ç¥á¥½¥Ã¥É¤ËÉÕ¿ï¤Ç¤¤ë¥á¥½¥Ã¥É¤Ç¤¹¡£¤³¤ÎÌ¿ÎáñÂΤǼ¹Ԥ¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£
SetLink ¥á¥½¥Ã¥É¤òÉÕÍ¿¤¹¤ë¤³¤È¤Ç°ì½ï¤ËÌ¿Îᤷ¤Æ¤¤¤ë DOTween ¤Î½ªÎ»¤¹¤ë¥¿¥¤¥ß¥ó¥°¤ò¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀ¸Â¸´ü´Ö(ÇË´þ¤Î¥¿¥¤¥ß¥ó¥°)¤Ëɳ¤Å¤±¤Æ¡¢
¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇË´þ¤ÈƱ»þ¤Ë DOTween ¤Î½èÍý¤ò½ªÎ»¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¡¡DOTween ¤Î½èÍý¤ÏÈóƱ´ü½èÍý¤È¸Æ¤Ð¤ì¤ë¼ïÎà¤Î¤â¤Î¤Ç¤¢¤ê¡¢°ìÅÙ½èÍý¤¬¼Â¹Ô¤µ¤ì¤ë¤È¡¢¤½¤Î½èÍý¤¬Àµ¾ï¤Ë½ªÎ»¤¹¤ë¤Þ¤Ç¤Ï¥¥ã¥ó¥»¥ë¤Ç¤¤Þ¤»¤ó¡£
DOTween ¤ò¼Â¹Ô¤·¤¿¥¹¥¯¥ê¥×¥È¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ÇË´þ¤µ¤ì¤ë¤È¡¢DOTween ¤Î½èÍý¤¬ÅÓÃæ¤Ç¤¢¤Ã¤¿¾ì¹ç¡¢½èÍý¤À¤±¤¬»Ä¤ê³¤±¤Æ¤·¤Þ¤¦²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹¡£
¡¡
¡¡¤½¤¦¤Ê¤Ã¤¿¾ì¹ç¡¢DOTween ¦¤«¤é Console ¥Ó¥å¡¼¤ËÂФ·¤Æ¡¢·Ù¹ð¤Î·Á¤ÇÄÌÃΤµ¤ì¤Þ¤¹¡£
¤½¤¦¤¤¤Ã¤¿¥±¡¼¥¹¤¬ÁÛÄꤵ¤ì¤ë¾ì¹ç¡¢SetLink ¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ¡¢¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ÇË´þ¤µ¤ì¤ë¤ÈƱ»þ¤Ë¡¢DOTween ¤Î½èÍý¤â½ªÎ»¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
transform.DOMoveY(transform.position.y - moveRange, moveTime) ¡¡¡¡¡¡.SetEase(Ease.Linear) ¡¡¡¡¡¡.SetLoops(-1, LoopType.Yoyo) ¡¡¡¡¡¡.SetLink(gameObject);
¡¡SetLoops ¥á¥½¥Ã¥É¤È°ì½ï¤ËÍøÍѤ¹¤ë¥±¡¼¥¹¤¬Â¿¤¤¤Ç¤¹¡£
Æä˥롼¥×¤Î²ó¿ô¤¬ÌµÀ©¸Â¤Î¾ì¹ç¤Ë¤Ï¡¢É¬¤º SetLink ¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÇË´þ¤Î¥¿¥¤¥ß¥ó¥°¤Èɳ¤Å¤±¤ÆÍøÍѤ·¤Þ¤¹¡£
¡¡ÈóƱ´ü½èÍý¤Ç¤¢¤ë DOTween ¤Î½èÍý¤Ï¡¢¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ÇË´þ¤µ¤ì¤¿¤¢¤È¤â¼«Æ°Åª¤Ë¤ÏÄä»ß¤·¤Þ¤»¤ó¡£
Ä̾ï¤Ï»þ´Ö¤ÎÀßÄêÃͤ¬¤¢¤ë¤¿¤á¡¢¤½¤Î»þ´Ö¤¬½ªÎ»¸å¤Ë¼«Æ°Åª¤ËÄä»ß¤¹¤ë¤Î¤Ç¤¹¤¬¡¢Ìµ¸Â¥ë¡¼¥×¤Î¾ì¹ç¡¢»ß¤Þ¤ë¥¿¥¤¥ß¥ó¥°¤¬¤¢¤ê¤Þ¤»¤ó¡£
¤³¤ì¤Ë¤è¤ê¥×¥í¥°¥é¥à¤ÎÆâÉô¤Ç¤Ï̵À©¸Â¤Ë DOTween ¤¬Æ°ºî¤·¤Ä¤Å¤±¤Æ¤·¤Þ¤¦¤³¤È¤Ë¤Ê¤ê¡¢ÉÔ¶ñ¹ç¤Î¸¶°ø¤È¤Ê¤ê¤Þ¤¹¡£
¡¡DOTween ¤Î½ªÎ»¤Î¥¿¥¤¥ß¥ó¥°¤òɳ¤Å¤±¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢SetLink ¥á¥½¥Ã¥É¤Î°ú¿ô¤Ë»ØÄꤷ¤ÆÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£
GameObject ·¿¤Ç¤¢¤ì¤Ð»ØÄê¤Ç¤¤Þ¤¹¤Î¤Ç¡¢¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤·¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È°Ê³°¤Ç¤âÀßÄê¤Ç¤¤Þ¤¹¡£
SetLink(gameObject);¡¡¡¡¡¡¡¡// ¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤·¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ëɳ¤Å¤±¤ë SetLink(enemy.gameObject);¡¡// enemy ÊÑ¿ô¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ëɳ¤Å¤±¤ë
¡¡·«¤êÊÖ¤·¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢SetLoops ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤¿¾ì¹ç¡¢¤½¤Î¥ë¡¼¥×¤Î²ó¿ô¤¬ÌµÀ©¸Â¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï SetLink ¥á¥½¥Ã¥É¤òÍøÍѤ¹¤ë¤³¤È¤Ç
̵¸Â¥ë¡¼¥×¤Ë¤Ê¤Ã¤Æ¤¤¤ë DOTween ¤Î½èÍý¤òŬÀڤʥ¿¥¤¥ß¥ó¥°¤Ç½ªÎ»¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡¤Ê¤ª¡¢DOTween ¤Î Set¡Á ¤Ç»Ï¤Þ¤ë¥á¥½¥Ã¥É¤òµ½Ò¤¹¤ë½çÈÖ¤ÏǤ°Õ¤Ç¤¹¡£¤É¤Î Set¡Á ¤«¤é½ñ¤«¤Ê¤¤¤ÈÆ°ºî¤·¤Ê¤¤¡¢¤È¤¤¤¦¥ë¡¼¥ë¤Ï¤¢¤ê¤Þ¤»¤ó¡£
¤½¤Î¤¿¤á¡¢²¼µ¤Î¤è¤¦¤Ê½çÈ֤ǵ½Ò¤·¤ÆƱÍͤËÆ°ºî¤·¤Þ¤¹¡£
<¸½ºß¤Î½ñ¼°>
transform.DOMoveY(transform.position.y - moveRange, moveTime) ¡¡¡¡¡¡.SetEase(Ease.Linear) ¡¡¡¡¡¡.SetLoops(-1, LoopType.Yoyo) ¡¡¡¡¡¡.SetLink(gameObject);
<Set¡Á ¥á¥½¥Ã¥É¤Î½çÈÖ¤òÊѤ¨¤¿¾ì¹ç¡>
transform.DOMoveY(transform.position.y - moveRange, moveTime) .SetLink(gameObject) ¡¡¡¡¡¡.SetEase(Ease.Linear) ¡¡¡¡¡¡.SetLoops(-1, LoopType.Yoyo);¡¡¡¡¡¡
<Set¡Á ¥á¥½¥Ã¥É¤Î½çÈÖ¤òÊѤ¨¤¿¾ì¹ç¢>
transform.DOMoveY(transform.position.y - moveRange, moveTime) .SetLoops(-1, LoopType.Yoyo) ¡¡¡¡¡¡.SetEase(Ease.Linear) ¡¡¡¡¡¡.SetLink(gameObject);
¡¡¤¿¤À¤·¡¢Â¿¤¯¤Î¾ì¹ç¡¢¼ç¥á¥½¥Ã¥É¤Î¸å¤Ë¤Ï SetEase ¥á¥½¥Ã¥É¤òµ½Ò¤¹¤ë¥±¡¼¥¹¤¬Â¿¤¤¤Ç¤¹¡£
¤Þ¤¿ SetLoops ¥á¥½¥Ã¥É¤È SetLink ¥á¥½¥Ã¥É¤Ï°ì½ï¤Ëµ½Ò¤¹¤ë¤³¤È¤¬Â¿¤¤¤Ç¤¹¤¬¡¢¤½¤Î¾ì¹ç¤Ï¤É¤Á¤é¤«¤éµ½Ò¤·¤Æ¤âÌäÂꤢ¤ê¤Þ¤»¤ó¡£
¡¡Tween ·¿¡¢¤¢¤ë¤¤¤Ï Tweener ·¿¤ËÂåÆþ¤·¤Æ¤¤¤ë DOTween ¤Î½èÍý¤ò½ªÎ»¤¹¤ë¥á¥½¥Ã¥É¤Ç¤¹¡£
¡¡´ðËÜŪ¤Ë DOTween ¤Î½èÍý¤Ï»ØÄꤷ¤¿»þ´Ö¤ÈƱ»þ¤Ë¼«Æ°Åª¤Ë½ªÎ»¤·¤Þ¤¹¡£
¤¿¤À¤·¡¢½èÍý¤ÎÅÓÃæ¤Ç¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ÇË´þ¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¤ê¡¢SetLoops ¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ¥ë¡¼¥×¤ò¤·¤Æ¤¤¤ëºÇÃæ¤Ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ÇË´þ¤µ¤ì¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¡¢
¤½¤Î DOTween ¤ÏÀµ¾ï¤ËÆ°ºî¤ò½ªÎ»¤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢ÇË´þ¤µ¤ì¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ËÂФ·¤ÆÌ¿Îá¤ò¤ª¤³¤Ê¤ª¤¦¤È¤·¤Þ¤¹¡£
¡¡¤½¤ì¤òËɤ°¤¿¤á¡¢¾åµ¤Î¤è¤¦¤Ê¥±¡¼¥¹¤¬ÁÛÄꤵ¤ì¤ë DOTween ¤Î½èÍý¤Ë¤Ä¤¤¤Æ¤Ï¡¢Å¬Àڤʥ¿¥¤¥ß¥ó¥°¤Ç Kill ¥á¥½¥Ã¥É¤òÍøÍѤ·¤Æ
½èÍý¤ò½ªÎ»¤µ¤»¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
¡¡Â¿¤¯¤Î¥×¥í¥°¥é¥ß¥ó¥°¤Ç¤Ï¡¢½èÍý¤ÎºÇ½é¤ÈºÇ¸å¤ò¤·¤Ã¤«¤ê¤È¹Í¤¨¤Æµ½Ò¤·¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
¡¡¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤¿¤é¥»¡¼¥Ö¤ò¹Ô¤¤¡¢¥Ò¥¨¥é¥ë¥¡¼¤Î Eagle ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë VerticalFloatingObject ¥¹¥¯¥ê¥×¥È¤ò¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥¿¥Ã¥Á¤·¤Þ¤¹¡£
Eagle ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¤Æ¡¢ VerticalFloatingObject ¥¹¥¯¥ê¥×¥È¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ò³Îǧ¤·¤Þ¤¹¡£public ½¤¾þ»Ò¤ÇÀë¸À¤·¤¿ÊÑ¿ô¤¬£²¤Äɽ¼¨¤µ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢ÃͤòÀßÄꤷ¤Þ¤¹¡£
Eagle ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡moveTime ÊÑ¿ô¤Ï¡¢DOTween ¤Î½èÍý¤ËÍøÍѤ·¤Æ¤¤¤ëÊÑ¿ô¤Ç¡¢¤³¤ÎÊÑ¿ô¤ÎÃͤλþ´Ö¤ò¤«¤±¤Æ¡¢¾å²¼¤Î°ÜÆ°¤ò¹Ô¤¤¤Þ¤¹¡£
½é´üÃÍ¤Ï 0 ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç 2 ¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£¤³¤¦¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¸½ºß¤Î°ÌÃÖ¤«¤é°ÜÆ°¤ò¹Ô¤¤¡¢ºÇ¸å¤Ë¸½ºß¤Î°ÌÃÖ¤ËÌá¤ë¤Þ¤Ç 2 É䫤±¤Æ°ÜÆ°¤ò¹Ô¤¦¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡moveRange ÊÑ¿ô¤â DOTween ¤Î½èÍý¤ËÍøÍѤ·¤Æ¤¤¤ëÊÑ¿ô¤Ç¡¢¤³¤ÎÊÑ¿ô¤ÎÃͤ¬¾å²¼¤Î°ÜÆ°¤ÎÉý¤Ë¤Ê¤ê¤Þ¤¹¡£
½é´üÃÍ¤Ï 0 ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤Î¤Ç 2 ¤ËÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£¸½ºß¤Î°ÌÃÖ¤«¤é²¼Êý¸þ¤Ø 2.0 °ÜÆ°¤·¤Þ¤¹¡£
¡¡moveTime ÊÑ¿ô¤ÎÃͤ¬Â礤¤¤Û¤É¡¢1²óÊÕ¤ê¤Î¾å²¼¤Î°ÜÆ°¤Ë¤«¤«¤ë»þ´Ö¤¬Ä¹¤¯¤Ê¤ê¡¢moveRange ÊÑ¿ô¤ÎÃͤ¬Â礤¤¤Û¤É¡¢£±²ó¤Î°ÜÆ°¤Îµ÷Î¥¤¬Ä¹¤¯¤Ê¤ê¤Þ¤¹¡£
¼ÂºÝ¤ËÆ°¤¯ÍͻҤò¸«¤Ê¤¬¤éÄ´À°¤ò¹Ô¤¤¤Þ¤·¤ç¤¦¡£
ÀßÄê¸å¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡ÀßÄ꤬´°Î»¤·¤Þ¤·¤¿¤Î¤Ç¡¢¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ³Îǧ¤·¤Þ¤¹¡£
¡¡¥²¡¼¥à¤¬¥¹¥¿¡¼¥È¤¹¤ë¤È¡¢Eagle ¥²¡¼¥à¤¬¾å²¼Êý¸þ¤Ë°ÜÆ°¤·¤Ê¤¬¤é¡¢²èÌ̤κ¸Â¦¤Ø¤È°ÜÆ°¤ò¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
MoveObject ¥¹¥¯¥ê¥×¥È¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¥²¡¼¥à²èÌ̤«¤é¾Ã¤¨¤Æ¾¯¤·¤¹¤ë¤È¼«Æ°Åª¤ËÇË´þ¤µ¤ì¤Þ¤¹¡£
¡ã¼Â¹ÔÆ°²è¡¡¾å²¼°ÜÆ°¤·¤Ê¤¬¤é²èÌ̺¸Â¦¤Ø°ÜÆ°¤¹¤ë¡ä
https://gyazo.com/fe32fe621b42c0bc0e9eacfd770fda7f
¡ã¼Â¹ÔÆ°²è¡¡¥²¡¼¥à²èÌ̤«¤é¾Ã¤¨¤¿¤éÇË´þ¤µ¤ì¤ë¡ä
https://gyazo.com/c35bc017174d3d4652f1baf6c4073558
¡¡¤Þ¤¿¥¥ã¥é¤ÈEagle ¥²¡¼¥à¤Ë¤Ï¥³¥é¥¤¥À¡¼¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¥³¥é¥¤¥À¡¼¤È¥³¥é¥¤¥À¡¼¤¬ÀÜ¿¨¤·¤Æ¥ª¥Ö¥¸¥§¥¯¥È¤òÄ̲᤹¤ë¤³¤È¤¬½ÐÍè¤Ê¤¤¤Ï¤º¤Ç¤¹¡£
¡Ê¾²¤ÈƱ¤¸¤è¤¦¤Ê¾õÂÖ¡Ë
¡ã¼Â¹ÔÆ°²è¡¡¥³¥é¥¤¥À¡¼Æ±»Î¤ÇÀÜ¿¨¤¹¤ë¡ä
https://gyazo.com/03ee1f4de9a3b8d8a9ce21adcb45c224
¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£
¡¡¼¡¤Ï¡¡¼ê½ç£±£µ¡¡¡Ý¾ã³²Êª¤È¥¥ã¥é¡¦¥Ð¥ë¡¼¥ó¤ÎÀÜ¿¨½èÍý¤Î¼ÂÁõ¡Ý¡¡¤Ç¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯