ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2023ǯ07·î15Æü(ÅÚ) 20:56:00ÍúÎò
¡¡ÆÃÄê¤ÎÃÏÅÀ¤Ë¥×¥ì¥¤¥ä¡¼¤¬¿¯Æþ¤·¤¿ºÝ¡¢Cinemachine ¤ÎÀÚ¤êÂؤ¨¤ò¹Ô¤Ã¤Æ¡¢¥Õ¥©¡¼¥«¥¹¤¹¤ëÂоݤò¥×¥ì¥¤¥ä¡¼°Ê³°¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤·¤Þ¤¹¡£
¤³¤ÎºÝ¤Ë¤Ï¡¢¥Õ¥©¡¼¥«¥¹¤µ¤ì¤Æ¤¤¤ë¥ª¥Ö¥¸¥§¥¯¥È¤¬°ÜÆ°¤òȼ¤¦¤³¤È¤¬¤Ç¤¡¢¤½¤Î¾ì¹ç¤Ë¤â Cinemachine ¤¬Äɽ¾¤·¤ÆÆ°¤¤Þ¤¹¡£
¡¡¥Õ¥©¡¼¥«¥¹ÂоݤΥª¥Ö¥¸¥§¥¯¥È¤Î°ÜÆ°¤¬¤Ê¤¤¾ì¹ç¡¢¤¢¤ë¤¤¤Ï°ÜÆ°¤¬½ªÎ»¤·¤¿»þÅÀ¤Ç¡¢¸µ¤Î Cinemachine ¤ËÀÚ¤êÂؤ¨¤Þ¤¹¡£
¡¡£²ÅÀ´Ö¤Î¥«¥á¥é¤ÎÀÚ¤êÂؤ¨Â®ÅÙ¡¢ÂÔµ¡»þ´Ö¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Î°ÜÆ°»þ´Ö¤Ê¤É¤âÄ´À°¤Ç¤¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡ã¼ÂÁõÆ°²è¢¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡¤³¤Î¼ÂÁõÎã¤Ç¤Ï Cinemachine ¤Î¾¤Ë¡¢UTAGE ¥¢¥»¥Ã¥È¤òÍøÍѤ·¤Æ¤¤¤Þ¤¹¡£
¤Þ¤¿¡¢¥¤¥Ù¥ó¥È½èÍý¼«ÂÎ¤Ë¤Ï GameEventHandler ¤òÍøÍѤ·¤¿½èÍý¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¡¡UTAGE ¤Ë¤Ä¤¤¤Æ¤Ï²ñÏÃ¥¤¥Ù¥ó¥È¤Ø¤ÎɳÉÕ¤±¤Ê¤É¤ÇÍøÍѤ¹¤ë¤¿¤á¡¢¥¢¥»¥Ã¥È¤ÎÍøÍѤÏǤ°Õ¤Ç¤¹¡£
¡¡¤¿¤À¤·¡¢GameEventHandler ¤Îµ¡Ç½¤Ïɬ¤ºÍøÍѤ·¤Þ¤¹¤Î¤Ç¡¢¤³¤Á¤é¤«¤é»öÁ°¤Ë¼ÂÁõ¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
¡¡¡¡¡¡=>¡¡½èÍý¤ÎÃê¾Ý²½¤Ë¤è¤ë¼ÂÁõÎã¡
¡¡¡¡¡¡¡¡¡¡½èÍý¤ÎÃê¾Ý²½¤Ë¤è¤ë¼ÂÁõÎã¢
¡¡¡¡¡¡¡¡¡¡½èÍý¤ÎÃê¾Ý²½¤Ë¤è¤ë¼ÂÁõÎã£
¡¡¡¡¡¡¡¡¡¡½èÍý¤ÎÃê¾Ý²½¤Ë¤è¤ë¼ÂÁõÎã¤
¡¡¡¡¡¡¡¡¡¡½èÍý¤ÎÃê¾Ý²½¤Ë¤è¤ë¼ÂÁõÎã¥
¡¡
¡¡½èÍý¤ÎÁ´ÂΤÎή¤ì¤Ç¤¹¡£
£±¡¥¥·¡¼¥óÆâ¤Ë¡¢¸«¤¨¤Ê¤¤¥³¥é¥¤¥À¡¼¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È LocationEventTrigger ¤òÇÛÃÖ¤·¤Æ¡¢ÀßÄꤹ¤ë ¡¡¡¡¡¡¢ £²¡¥¡Ú£±¡Û¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¿¯Æþ¤¹¤ë¤È¡¢PlayerManager ¤Î OnTriggerEnter2D ¥á¥½¥Ã¥É¤¬´¶ÃΤ·¡¢ ¡¡¡¡¤½¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë LocationEventTrigger ¥¯¥é¥¹¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¤«³Îǧ¤¹¤ë ¡¡¡¡³Îǧ¤Î¤È¤¤Ë¤Ï°ì½ï¤Ë¡¢UTAGE ¤Î²ñÏÃ¥¤¥Ù¥ó¥È¤Ë´ØÏ¢¤·¤Æ¤¤¤ë¤«¡¢²ñÏÃ¥¤¥Ù¥ó¥È¤Ï´Ø·¸¤Ê¤¯Ã±½ã¤Ë¤½¤Î°ÌÃ֤ˤ¤¤±¤Ð¤¤¤¤¤Î¤«¤ÇȽÄꤹ¤ë ¡¡¡¡¡¡¢ £³¡¥¡Ú£²¡Û¤ÎȽÄê¤Ç OK ¤¬½Ð¤¿¤é¡¢LocationEventTrigger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î GameEventHandler ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë GameEvent ¤ò¼Â¹Ô¤¹¤ë ¡¡¡¡¤³¤Î¤È¤¡¢GameEventCameraManipulator ¥¯¥é¥¹¤ò¥¢¥µ¥¤¥ó¤·¤Æ¤ª¤¯¤³¤È¤Ç¡¢Cinemachine ¤ÎÀ©¸æ¤ò¹Ô¤¦ GameEvent ¤¬È¯À¸¤¹¤ë ¡¡¡¡Â¾¤Î GameEvent ¤ÈƱ¤¸¤Ç¡¢¥¥ã¥é¤Î°ÜÆ°¤Ï¤Ç¤¤Ê¤¤¾õÂ֤ˤʤꡢ¾¤Î GameEvent ¤Ë¤âÁȤ߹þ¤á¤ë
¡¡¤³¤Á¤é¤Îή¤ì¤òǰƬ¤ËÃÖ¤¤¤Æ¤¤¤¿¤À¤¤¤Æ¡¢¼ÂÁõ¤Ë¥Á¥ã¥ì¥ó¥¸¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡¤Þ¤¿¡¢¤³¤Î¤¿¤á¤Î½àÈ÷¤È¤·¤Æ¡¢£²ÂæÌܤΠCinemachine ¤ÎºîÀ®¤È¡¢MainCamera ¤ÎÀßÄ꤬¤¢¤ê¤Þ¤¹¡£
¡¡ºÇ½é¤Ë¤½¤Á¤é¤«¤é½àÈ÷¤·¤Æ¤¤¤¤Þ¤¹¡£
¡¡¸½ºß¤¢¤ë¡¢¼ç¤Î Cinemachine ¤òÊ£À½¤·¤ÆºîÀ®¤·¤Æ¤¤¤¯¤ÈÊØÍø¤Ç¤¹¡£Ì¾Á°¤ÏǤ°Õ¤Î̾Á°¤ËÊѤ¨¤Æ¤¯¤À¤µ¤¤¡£
¤¿¤À¤·¡¢Ê£À½¤·¤¿¾ì¹ç¡¢Cinemachine Confiner ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ì¤Ïºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡Priority ¤Ï¡¢ºÇ½é¤Ë¤¢¤ë¼ç¤Ç Cinemachine ¤è¤ê¤âÄ㤤¿ô»ú¤Ë¤·¤Æ¤ª¤¤Þ¤¹¡£
¡¡Follow ¤Ë¤Ï¡¢¥Õ¥©¡¼¥«¥¹¤·¤¿¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò¥¢¥µ¥¤¥ó¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
¡¡²¼µ¤Ï»²¹ÍÃͤǤ¹¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡Main Camera ¤Î CinemachineBrain ¤Ø¤Î Custom Blends ¤ÎÀßÄê¤ò¹Ô¤¤¤Þ¤¹¡£
¡¡¤³¤³¤Ë¸ÄÊ̤ËÀßÄꤷ¤Ê¤¤¾ì¹ç¡¢¤½¤Î¾å¤Ë¤¢¤ë Default Blends ¤ÎÀßÄ꤬͸ú¤Ë¤Ê¤Ã¤ÆÆ°¤¤Þ¤¹¡£
¡¡¤½¤Î¤¿¤á¡¢´ðËÜŪ¤Ë¤Ï¡¢A ¢ª B¡¢B ¢ª A ¤Î¤è¤¦¤ËÆ°¤«¤·¤¿¤¤¤È¤¤Ë¡¢±ýÉü¤Ç»þ´Ö¤òÊѤ¨¤¿¤¤¤È¤¤ä¡¢Style ¤Ç¥¢¥Ë¥á¤ÎÆ°ºî¤òÊѤ¨¤¿¤¤¤È¤¤Ë¤Ï
º£²ó¤Î¤è¤¦¤Ë Custom Blends ¤ò»È¤¤¤Þ¤¹¡£ºÇ½é¤Ëºî¤Ã¤¿¥¢¥»¥Ã¥È¤Ë¡¢¤³¤Î¾ðÊ󤬵Ͽ¤µ¤ì¤Þ¤¹¡£
¡¡¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢Default Blends ¤ò¤½¤Î¤Þ¤Þ»È¤Ã¤Æ¤¤¤¿¤À¤¤¤ÆÌäÂꤢ¤ê¤Þ¤»¤ó¡£
¤³¤ÎÊÕ¤ê¤â¿¤¯¤Îµ»ö¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤½¤ì¤é¤âÄ´¤Ù¤¿¤ê¡¢¤¢¤ë¤¤¤Ï¡¢¼ÂºÝ¤ËÁàºî¤·¤Æ³Îǧ¤·¤Æ¤¤¤Ã¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¤³¤Î¶µºàÆâ¤Ë¤â¾Ò²ðµ»ö¤¬¤¢¤ê¤Þ¤¹¡£
¡¡¡¡=>¡¡Ê£¿ô¤Î Cinemachine Virtual Camera ¤ÎÀÚ¤êÂؤ¨¼ÂÁõÎã
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡¥Ò¥¨¥é¥ë¥¡¼¤Ë¤Æ Create Empty ¤ò¹Ô¤¤¡¢¿·¤·¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¡¢Ì¾Á°¤ò LocationEventTrigger ¤Ë¤·¤Þ¤¹¡£
¤³¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ï¡¢¥×¥ì¥¤¥ä¡¼¤¬¿¯Æþ¤¹¤ë¤³¤È¤Ç¥¤¥Ù¥ó¥È¤òȯÀ¸¤µ¤»¤ëÌò³ä¤ò»ý¤Á¤Þ¤¹¡£
¤½¤Î¤¿¤á¡¢Ç¤°Õ¤Î·Á¾õ¤Î¥³¥é¥¤¥À¡¼¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
¡¡²¼µ¤Ï»²¹ÍÃͤǤ¹¡£
¡¡¶õ¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¾ì¹ç¡¢Scene¥Ó¥å¡¼¤Ç¤â¸«¤¨¤Ê¤¤¤¿¤á¡¢¥é¥Ù¥ë¤òÀßÄꤷ¤Æ¤ª¤¤Þ¤·¤ç¤¦¡£
Scene¥Ó¥å¡¼²èÁü
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡Â³¤¤¤Æ¡¢LocationEventTrigger¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤Þ¤¹¡£
¡¡UTAGE ¤òÍøÍѤ¹¤ë¾ì¹ç¤È¡¢ÍøÍѤ·¤Ê¤¤¾ì¹ç¤ÇÄ󼨤·¤Þ¤¹¡£
using UnityEngine; public class LocationEventTrigger : MonoBehaviour { [SerializeField] protected UtageParamBoolName utageParamBoolName; /// <summary> /// ÆÃÄê¤ÎÃÏÅÀ¤Ë¥×¥ì¥¤¥ä¡¼¤¬¿¯Æþ¤·¤¿ºÝ¤Ë GameEvent ¤¬È¯À¸¤¹¤ë¤«³Îǧ /// </summary> /// <returns></returns> public bool JudgeLocationEvent() { // ²ñÏÃ¥¤¥Ù¥ó¥È¤Ë´Ø·¸¤Ê¤¯È¯À¸¤¹¤ë¤«³Îǧ if (utageParamBoolName == UtageParamBoolName.NoItem) { Debug.Log("UTAGE ¤Î²ñÏÃ¥¤¥Ù¥ó¥È¤Ë´Ø·¸¤Ê¤¯¡¢¤³¤ÎÃÏÅÀ¤Ë¿¯Æþ¤·¤¿¤é GameEvent ȯÀ¸"); return true; } // ²ñÏÃ¥¤¥Ù¥ó¥È¤Ëɳ¤Å¤¤¤¿¥¤¥Ù¥ó¥È¤Ç¤¢¤ë¤«³Îǧ if (AdvEngineController.instance.AdvEngine.Param.GetParameterBoolean(utageParamBoolName.ToString())) { Debug.Log("UTAGE ¤Î²ñÏÃ¥¤¥Ù¥ó¥È¤Ëɳ¤Å¤¤¤¿·Á¤Ç GameEvent ȯÀ¸"); return true; } // ¤½¤ì°Ê³° Debug.Log("¾ò·ï¤Ë¹çÃפ·¤Ê¤¤¤¿¤á¡¢¤³¤ÎÃÏÅÀ¤Ë¤ª¤±¤ë GameEvent ¤ÎȯÀ¸¤Ê¤·"); return false; } }
¡¡¥¹¥¯¥ê¥×¥È¤ÎÆâÍƤǤ¹¤¬¡¢6¹ÔÌܤΠutageParamBoolName ¤Ï¡¢²ñÏÃ¥¤¥Ù¥ó¥È¤Ëɳ¤Å¤¯¾ì¹ç¤ËÍøÍѤ·¤Þ¤¹¡£
13¹ÔÌܤǤ³¤ÎÃͤò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢²ñÏÃ¥¤¥Ù¥ó¥È¤Ë´Ø·¸¤Ê¤¯È¯À¸¤µ¤»¤¿¤¤¾ì¹ç¤Ë¤Ï¡Ö¡×¤ò¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤ÇÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
ÆÃÄê¤ÎUTAGE ¤Î²ñÏ䬽ª¤ï¤Ã¤Æ¤«¤é¤Ç¤Ê¤±¤ì¤ÐÈ¿±þ¤·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢´ØÏ¢¤¹¤ëÃͤòÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
using UnityEngine; public class LocationEventTrigger : MonoBehaviour { ¡¡¡¡// TODO ¥¤¥Ù¥ó¥È¤Î¾ò·ï¤Ê¤É¤ò¡¢ÊÑ¿ô¤òºîÀ®¤·¤ÆǤ°Õ¤ËÀßÄꤹ¤ë /// <summary> /// ÆÃÄê¤ÎÃÏÅÀ¤Ë¥×¥ì¥¤¥ä¡¼¤¬¿¯Æþ¤·¤¿ºÝ¤Ë GameEvent ¤¬È¯À¸¤¹¤ë¤«³Îǧ /// </summary> /// <returns></returns> public bool JudgeLocationEvent() { // ¥¤¥Ù¥ó¥È¤Ë¤è¤Ã¤ÆȯÀ¸¤¹¤ë¤«³Îǧ if ('¥¤¥Ù¥ó¥È¤Ëɳ¤Å¤¯¾ò·ï¤¬¤¢¤ì¤ÐǤ°ÕÀßÄê') Debug.Log("¥¤¥Ù¥ó¥È¤Î¾ò·ï¤Ë¹çÃפ·¤¿¤Î¤ÇGameEvent ȯÀ¸"); return true; } // ¤½¤ì°Ê³° Debug.Log("¾ò·ï¤Ë¹çÃפ·¤Ê¤¤¤¿¤á¡¢¤³¤ÎÃÏÅÀ¤Ë¤ª¤±¤ë GameEvent ¤ÎȯÀ¸¤Ê¤·"); return false; } }
¡¡¤É¤Á¤é¤Î¾ì¹ç¤â¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤¿¤é¥»¡¼¥Ö¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡LocationEventTrigger ¥¹¥¯¥ê¥×¥È¤ò¡¢Àè¤Û¤ÉºîÀ®¤·¤¿ LocationEventTrigger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¢¥¿¥Ã¥Á¤·¤ÆÍøÍѤ·¤Þ¤¹¡£
¡¡¤³¤Î¤¢¤È¡¢¥×¥ì¥¤¥ä¡¼Â¦¤Ë¤â¿·¤·¤¯½èÍý¤òÄɲä·¡¢¤³¤ÎÃÏÅÀ¤Ë¥×¥ì¥¤¥ä¡¼¤¬¿¯Æþ¤·¤¿ºÝ¤Ë¡¢¥¤¥Ù¥ó¥È¤¬È¯À¸¤¹¤ë¤«¡¢¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡¤³¤³¤Ç¤Ï UTAGE ÍѤÎÀßÄê¤òÍøÍѤ¹¤ë¤â¤Î¤ò¥¢¥¿¥Ã¥Á¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¼¡¤Ë¡¢¿·¤·¤¤ GameEvent ¤òºîÀ®¤·¤Þ¤¹¡£
¡¡GameEventBase ¥¯¥é¥¹¤ò·Ñ¾µ¤·¤¿¡¢GameEventCameraManipulator ¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤Þ¤¹¡£
¡¡¤³¤ì¤Ï¡¢¤Û¤«¤Î GameEvent ¤ÈƱ¤¸¤è¤¦¤Ë¡¢È¯À¸¤µ¤»¤¿¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë GameEventHander ¤È¤³¤ì¤ò¥¢¥¿¥Ã¥Á¤·¤Æ¡¢¤½¤³¤Ë¥¢¥µ¥¤¥ó¤·¤ÆÍøÍѤ·¤Þ¤¹¡£
¤è¤Ã¤Æ¡¢Cinemachine ¤Ë¤è¤ë¥¤¥Ù¥ó¥È¤â¡¢Â¾¤Î¥¤¥Ù¥ó¥È¤ÈƱÍÍ¡¢ÁȤ߹ç¤ï¤»¤ÆÍøÍѤ¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
using System.Collections; using UnityEngine; using Cinemachine; using DG.Tweening; /// <summary> /// Main Camera ¤Î Cinemachine Brain ¤Ë¤Æ2Âæ¤Î¥«¥á¥é¤ÎÀÚ¤êÂؤ¨Â®ÅÙ¤ÎÀßÄê¤ò¤ª¤³¤Ê¤Ã¤Æ¤ª¤¯ /// </summary> public class GameEventCameraManipulator : GameEventBase { [SerializeField] private CinemachineVirtualCamera mainCamera; // ¥á¥¤¥ó¤Î Cinemachine ¥«¥á¥é [SerializeField] private CinemachineVirtualCamera eventCamera; // ¥¤¥Ù¥ó¥ÈÍѤΠCinemachine ¥«¥á¥é [SerializeField] private Transform target; // °ÜÆ°¤µ¤»¤¿¤¤ÂоÝʪ(¤Ê¤±¤ì¤ÐÉÔÍ×) [SerializeField] private Transform destinationTran; // °ÜÆ°Àè [SerializeField] private float moveDuration; // °ÜÆ°»þ´Ö // ÈóÁªÂò»þ¤Î¥Ð¡¼¥Á¥ã¥ë¥«¥á¥é¤ÎÍ¥ÀèÅÙ [SerializeField] private int unselectedPriority = 0; // ÁªÂò»þ¤Î¥Ð¡¼¥Á¥ã¥ë¥«¥á¥é¤ÎÍ¥ÀèÅÙ [SerializeField] private int selectedPriority = 10; private bool isCameraTransitionComplete = false; private float intervalTime = 2.0f; /// <summary> /// Cinemachine ¤ÎµóÆ°À©¸æ /// </summary> /// <returns></returns> public override IEnumerator ExecuteEventCoroutine() { if (isCameraTransitionComplete) yield break; // ¥«¥á¥é¤ÎÍ¥Àè½ç°Ì¤ÎÀÚ¤êÂؤ¨ mainCamera.Priority = unselectedPriority; eventCamera.Priority = selectedPriority; // ¥«¥á¥é¤¬ÌÜɸ¤È¤Ê¤ëÂоݤΰÌÃ֤˰ÜÆ°¤¹¤ë¤Þ¤ÇÂÔµ¡ yield return new WaitForSeconds(intervalTime); // ÌÜɸ¤Î°ÜÆ°(¥«¥á¥é¤Ï¼«Æ°Äɽ¾) if (target) { yield return target.DOMove(destinationTran.position, moveDuration) .SetEase(Ease.Linear) .SetLink(gameObject) .WaitForCompletion(); } // ¥«¥á¥é¤ÎÍ¥Àè½ç°Ì¤ÎÀÚ¤êÂؤ¨(¸µ¤ËÌ᤹) eventCamera.Priority = unselectedPriority; mainCamera.Priority = selectedPriority; // ¥«¥á¥é¤¬¥×¥ì¥¤¥ä¡¼¤Î°ÌÃÖ¤ËÌá¤ë¤Þ¤ÇÂÔµ¡ yield return new WaitForSeconds(intervalTime); isCameraTransitionComplete = true; yield return false; } }
¡¡¤³¤Îµ¡Ç½¤Ï¡¢Cinemachine ¤Î¥«¥á¥é¤ÎÀÚ¤êÂؤ¨¤È¡¢¥«¥á¥é¤¬ÀÚ¤êÂؤï¤Ã¤¿¤¢¤È¡¢¿·¤·¤¤ÂоÝʪ¤Î°ÜÆ°Í̵¤òÁÛÄꤷ¤ÆºîÀ®¤·¤Æ¤¤¤Þ¤¹¡£
¡¡11¹ÔÌܤÈ12¹ÔÌܤˤϡ¢¤½¤ì¤¾¤ì¤Î¥«¥á¥é¤ò¥¢¥µ¥¤¥ó¤·¤Þ¤¹¡£¤É¤Á¤é¤â Cinemachine ¤Ç¤¹¡£
¡¡14¹ÔÌÜ¡Á16¹ÔÌܤϡ¢¥«¥á¥é¤¬ÀÚ¤êÂؤï¤Ã¤¿¤¢¤È¤Ë¡¢ÀÚ¤êÂؤï¤Ã¤¿Àè¤Ë¤¢¤ëÂоÝʪ¤¬°ÜÆ°¤¹¤ë¾ì¹ç¤ÎÀßÄêÃͤǤ¹¡£
ÂоÝʪ¤¬°ÜÆ°¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢Target ¤È DestinationTran ¤Ï None ¤Î¤Þ¤Þ¤Ç¹½¤¤¤Þ¤»¤ó¡£
¡¡¥á¥½¥Ã¥ÉÆâ¤Î½èÍý¤ÎÆâÍƤÏ
£±¡¥¥«¥á¥é¤Î Priority ¤ÎÀÚ¤êÂؤ¨ £²¡¥DOTween ¤Ë¤è¤ëÂоÝʪ¤Î°ÜÆ°(º£²ó¤Ï¡¢¤³¤ì¤Ï¤·¤Ê¤¤) £³¡¥¸µ¤Î¥«¥á¥é¤ËÌ᤹¤¿¤á¤Ë¡¢ºÆÅÙ¥«¥á¥é¤Î Priority ¤ÎÀÚ¤êÂؤ¨
¡¡¤È¤¤¤¦Î®¤ì¤Ç¤¹¡£½èÍý¤ÎÆâÍƤòÆɤ߲ò¤¤¤¿¾å¤Ç³èÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
µ½Ò¤¹¤ëºÝ¤Ë¤Ï¡¢¤É¤ó¤Ê½èÍý¤ò½ñ¤¤¤Æ¤¤¤ë¤Î¤«¤ò¥¤¥á¡¼¥¸¤·¤Ê¤¬¤é½ñ¤¤¤Æ¤¤¤¯¤È¤è¤¤¤È»×¤¤¤Þ¤¹¡£
LocationEventTrigger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë GameEventHandler ¥¹¥¯¥ê¥×¥È¤È GameEventCameraManipulator ¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤·¤ÆÀßÄê¤ò¹Ô¤¦
¡¡Ä̾ï¤Î¥²¡¼¥à¥¤¥Ù¥ó¥È¤ÈƱ¤¸¤è¤¦¤Ë¡¢GameEventHandler ¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤·¡¢
¤µ¤é¤Ëº£²ó¤Î¤¿¤á¤ËºîÀ®¤·¤¿ GameEventCameraManipulator ¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤·¤Æ¡¢GameEventHandler ¤Ë¥¢¥µ¥¤¥ó¤·¤Þ¤¹¡£
¡¡¤³¤Î¼ÂÁõÎã¤Ç¤Ï GameEventCameraManipulator ¤·¤«¥¢¥µ¥¤¥ó¤·¤Æ¤Þ¤»¤ó¤¬¡¢Â¾¤Î¥¤¥Ù¥ó¥È¤â°ì½ï¤ËÀßÄê²Äǽ¤Ç¤¹¡£
¡¡GameEventCameraManipulator ¥¹¥¯¥ê¥×¥È¤Ë¤Ï£²Âæ¤Î Cinemachine ¤ò¥¢¥µ¥¤¥ó¤·¤Þ¤¹¡£
£²ÂæÌܤΠCinemachine ¤Î¥Õ¥©¡¼¥«¥¹ÂоÝʪ¤¬°ÜÆ°¤¹¤ë¾ì¹ç¤Î¤ß¡¢Target ¤È Destination Tran ¤ÏÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡°Ê¾å¤Ç¤³¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ï´°À®¤Ç¤¹¡£
¡¡¡¡ºÇ¸å¤Ë PlayerMangaer ¥¹¥¯¥ê¥×¥È¤Ë¡¢¥á¥½¥Ã¥É¤ò£±¤ÄÄɲä·¤Þ¤¹¡£
¤É¤³¤Ç¤â¤è¤¤¤Î¤ÇÄɲ䷤Ƥ¯¤À¤µ¤¤¡£Â¿Ê¬¡¢°ìÈֺǸå¤ËÄɲ乤ë¤È¤ï¤«¤ê¤ä¤¹¤¤¤«¤È»×¤¤¤Þ¤¹¡£
private void OnTriggerEnter2D(Collider2D other) { // ¥¤¥Ù¥ó¥È¤ÎȯÀ¸¤¹¤ëÆÃÄê¤ÎÃÏÅÀ¤Ë¿¯Æþ¤·¡¢¤«¤Ä¡¢¥¤¥Ù¥ó¥È¤ÎȯÀ¸¾ò·ï¤òËþ¤¿¤·¤Æ¤¤¤ë¾ì¹ç if (other.TryGetComponent(out LocationEventTrigger locationEventTrigger) && locationEventTrigger.JudgeLocationEvent()) { // GameEvent ¼Â¹Ô StartCoroutine(StartEventCoroutine(locationEventTrigger.gameObject)); } }
¡¡¥×¥ì¥¤¥ä¡¼¤«¤é¸«¤Æ¡¢ÆÃÄê¤ÎÃÏÅÀ¤ËÍÑ°Õ¤·¤Æ¤¢¤ë¡¢¥³¥é¥¤¥À¡¼¤Î¤¢¤ë¸«¤¨¤Ê¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(LocationEventTrigger)¤Ë¿¯Æþ¤·¤¿¤È¤¡¢
¤½¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¡¢LocationEventTrigger ¥¹¥¯¥ê¥×¥È¤¬¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤ª¤ê¡¢
¤«¤Ä¡¢LocationEventTrigger Æâ¤ÎJudgeLocationEvent¥á¥½¥Ã¥É¤ò¼Â¹Ô¤·¤Æ¡¢¥¤¥Ù¥ó¥È¤ÎȯÀ¸¾ò·ï¤ËŬ¹ç¤·¤Æ¤¤¤ë(true)¤Ê¤é¡¢
GameEventHandler ¤ËÅÐÏ¿¤·¤¿¥¤¥Ù¥ó¥È¤òȯÀ¸¤µ¤»¤Þ¤¹¡£
¡¡¤Ä¤Þ¤ê¡¢¥Ü¥¿¥ó¤ò²¡¤·¤Æ Ray ¤Ë¤è¤ëȽÄê¤ò¤·¤Æ¤¤¤ëÉôʬ¤ò¡¢¿¯ÆþȽÄê¤ò»È¤Ã¤ÆƱ¤¸¤è¤¦¤Ê·Á¤Ç¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹¡£
¤³¤Î¤È¤¡¢¼Â¹Ô¤¹¤ë¥á¥½¥Ã¥É¤ÏƱ¤¸ StartEventCoroutine ¥á¥½¥Ã¥É¤Ê¤Î¤Ç¡¢GameEventHandler ¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥¤¥Ù¥ó¥È¤òȯÀ¸¤µ¤»¤Þ¤¹¡£
¡¡º£²ó¤Ï¡¢GameEventCameraManipulator ¤Î¤ß¤òȯÀ¸¤µ¤»¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¤¬¡¢¤³¤ì¼«ÂΤâ GameEvent ¤Ç¤¢¤ë¤¿¤á¡¢²ñÏÃ¥¤¥Ù¥ó¥È¤òÁ°¸å¤Ë¶´¤ó¤À¤ê¡¢Â¾¤Î¥¤¥Ù¥ó¥È¤ò¶´¤ó¤À¤ê¡¢¼«Í³¤ËÀßÄê¤Ç¤¤Þ¤¹¡£
¡¡ºÇ½é¤ËÄ󼨤·¤¿½èÍý¤ÎÆâÍƤòÉü½¬¤·¤¿¾å¤Ç¡¢¤É¤¦¤¤¤Ã¤¿µóÆ°¤Ë¤Ê¤Ã¤Æ¤¤¤ì¤Ð¤è¤¤¤«¡¢¥¤¥á¡¼¥¸¤òºî¤Ã¤¿¾å¤Ç¥Ç¥Ð¥Ã¥°¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£
¡¡¥×¥ì¥¤¥ä¡¼¤«¤é¸«¤Æ¡¢ÆÃÄê¤ÎÃÏÅÀ¤ËÍÑ°Õ¤·¤Æ¤¢¤ë¡¢¥³¥é¥¤¥À¡¼¤Î¤¢¤ë¸«¤¨¤Ê¤¤¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È(LocationEventTrigger)¤Ë¿¯Æþ¤·¤¿¤È¤¡¢
GameEvent ¤¬¼Â¹Ô¤µ¤ì¤Æ Cinemachine ¤¬ÀÚ¤êÂؤï¤ë½èÍý¤¬È¯À¸¤·¡¢¥¤¥Ù¥ó¥È½ªÎ»¸å¡¢ºÆÅÙ¡¢Cinemachine ¤¬¸µ¤Î¾õÂÖ¤ËÌá¤ì¤ÐÀ©¸æÀ®¸ù¤Ç¤¹¡£
¡ã¼ÂÁõÆ°²è¡¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡ã¼ÂÁõÆ°²è¢¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡
¡¡°Ê¾å¤Ç´°À®¤Ç¤¹¡£
¡¡±þÍѤǤ¤Þ¤¹¤Î¤Ç¡¢À§Èó¡¢¼«Ê¬¤Ç¹Í¤¨¤ÆÆ°¤«¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯