ºÇ½ª¹¹¿·¡§ orika_ex_miyako 2023ǯ05·î09Æü(²Ð) 17:12:16ÍúÎò
¡¡Cinemachine ¤Ë¤è¤Ã¤ÆÄ󶡤µ¤ì¤Æ¤¤¤ë Virtual Camera ¤Ï Priority ¤ÎÃͤˤè¤ê¡¢MainCamera ¤Ë±Ç¤ë¥«¥á¥é¤¬·èÄꤷ¤Þ¤¹¡£
Ê£¿ô¤Î Virtual Camera ¤ò¥²¡¼¥àÆâ¤ÇưŪ¤ËÀÚ¤êÂؤ¨¤¿¤¤¾ì¹ç¡¢³Æ Virtual Camera ¤Î Priority ¤ÎÃͤòÀ©¸æ¤¹¤ë¤³¤È¤ÇÀÚ¤êÂؤ¨¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡Ç¤°Õ¤Î¿ô¤Î Virtual Camera ¤ò¥Ò¥¨¥é¥ë¥¡¼¤ËÇÛÃÖ¤·¤ÆÀßÄê¤ò¤ª¤³¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤¡£
ºÇ½é¤ËÀßÄꤷ¤Æ¤¢¤ë Virtual Camera ¤òÊ£À½¤·¤ÆºîÀ®¤¹¤ë¤È¡¢Æ±¤¸ÀßÄê¤Î Virtual Camera ¤¬ºîÀ®¤µ¤ì¤ë¤¿¤á¡¢
¿·µ¬¤ËºîÀ®¤¹¤ë¤è¤ê¤â¸úΨ¤¬¤è¤¤¤Ç¤¹¡£
¡¡¤ï¤«¤ê¤ä¤¹¤¤Ì¾Á°¤Ë¤·¤Æ¡¢¥«¥á¥é¤Î´ÉÍý¤¬¤·¤ä¤¹¤¤´Ä¶¤Ë¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
¡¡ºÇ½é¤Ë£±ÂæÌܤΠVirtual Camera ¤ò¥Ò¥¨¥é¥ë¥¡¼¤ËÀßÃÖ¤¹¤ë¤È¡¢Main Camera ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë Cinemachine Brain ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤¬¼«Æ°Åª¤Ë¥¢¥¿¥Ã¥Á¤µ¤ì¤Þ¤¹¡£
(¥Ò¥¨¥é¥ë¥¡¼¤Ë¤¢¤ë Main Camera ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î±¦Â¦¤Ë Cinemachine ÍѤΥ¢¥¤¥³¥ó¤¬Äɲ䵤ì¤Þ¤¹)
¡¡Cinemachine Brain ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Ë¤Ï¡¢¸½ºß¤Î Virtual Camera ¤«¤éÊ̤ΠVirtual Camera ¤ËÀÚ¤êÂؤï¤ëºÝ¤Î Blend ÊýË¡(¥È¥é¥ó¥¸¥·¥ç¥ó¤Î»þ´Ö¤ä Style)¤òÀßÄꤷ¤Æ¤¤¤ë
Default Blend ¤È Custom Blends ¤Îµ¡Ç½¤¬¤¢¤ê¤Þ¤¹¡£
¤³¤Î¤¦¤Á¡¢ Custom Blend ¤Îµ¡Ç½¤òÍøÍѤ¹¤ë¤³¤È¤Ç¡¢¥«¥á¥é¤´¤È¤Î Blend ÊýË¡¤ò¸ÄÊÌÀßÄê¤Ç¤¤Þ¤¹¡£
»²¹Í¥µ¥¤¥È
Unity ¥Þ¥Ë¥å¥¢¥ë
Virtual Camera ´Ö¤Î¥Ö¥ì¥ó¥É
¡¡Virtual Camera Ʊ»Î¤¬ Priority ¤Ë¤è¤Ã¤ÆÀÚ¤êÂؤï¤ë¾ì¹ç¡¢´ðËÜŪ¤Ë¤Ï Default Blend ¤ò¥Ù¡¼¥¹¤Ë Blend ¤µ¤ì¤Æ¥«¥á¥é¤¬ÀÚ¤êÂؤï¤ê¤Þ¤¹¡£
¤³¤ÎºÝ¡¢Custom Blend ¤ÎÀßÄ꤬¤¢¤ë¤È¡¢»ØÄꤷ¤¿¥«¥á¥é¤Ë¤Ä¤¤¤Æ¤Ï¡¢Custom Blend ¤ÎÀßÄ꤬ͥÀ褵¤ì¤ÆÀÚ¤êÂؤï¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡Î㤨¤Ð¡¢A ¢ª B ¤Î Virtual Camera ¤Î Blend(¥È¥é¥ó¥¸¥·¥ç¥ó¤Î»þ´Ö¤ÈÀÚ¤êÂؤï¤êÊý(Style))¤È
B ¢ª C ¤Î Virtual Camera ¤Î Blend(¥È¥é¥ó¥¸¥·¥ç¥ó¤Î»þ´Ö¤ÈÀÚ¤êÂؤï¤êÊý(Style))¤Î¤è¤¦¤Ë¥«¥á¥é¤ò»ØÄꤷ¡¢ÀßÄꤷ¤Æ¤ª¤¯¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
¡¡Custom Blends ¤ÎÀßÄê¤ÏǤ°Õ¤Ç¤¹¡£
ÀßÄ꤬¤Ê¤±¤ì¤Ð¡¢¤É¤Î Virtual Camera ¤Ç¤¢¤Ã¤Æ¤â¡¢Default Blend ¤Î¾ðÊó¤ò»È¤Ã¤Æ¡¢Æ±¤¸¥È¥é¥ó¥¸¥·¥ç¥ó¤Î»þ´Ö¤È Style ¤òÍøÍѤ·¤ÆÀÚ¤êÂؤï¤ê¤Þ¤¹¡£
¤¿¤À¤·¡¢ÆÃÄê¤Î¥«¥á¥é´Ö¤Î¥È¥é¥ó¥¸¥·¥ç¥ó¤Ë¤ª¤¤¤ÆÀßÄꤷ¤Æ¤ª¤¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢¤³¤Î Custom Blend ¤Îµ¡Ç½¤ò³èÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
ÀßÄêÁ°¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡²¼µ¤Ï¥µ¥ó¥×¥ë¤Ç¤¹¡£
£²¤Ä¤¢¤ë Virtual Camera ¤Î Blend ÀßÄê¤Ë Custom Blends ¤òÀßÄꤷ¤Æ¤¤¤Þ¤¹¡£
¡¡½é´üÀßÄê¤Ç¤Ï Custom Blends ¤ÎÉôʬ¤Ï None ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
¤¹¤°¤Ë±¦Â¦¤Ë¤¢¤ë Create Asset ¥Ü¥¿¥ó¤òÁªÂò¤¹¤ë¤È¡¢¿·¤·¤¤ Blend ÀßÄê¤òÊݸ¤¹¤ë¤¿¤á¤Î Cinemachine Blender Settings ¥¢¥»¥Ã¥È¤¬ºîÀ®¤Ç¤¤Þ¤¹¡£
¡¡Cinemachine Blender Settings ¥¢¥»¥Ã¥È¤òºîÀ®¤¹¤ë¤È¼«Æ°Åª¤Ë Custom Blends ¤Ë¥¢¥µ¥¤¥ó¤µ¤ì¤Æ¡¢ÀßÄ꤬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
±¦²¼¤Î + ¥¢¥¤¥³¥ó¤ò²¡¤¹¤È£±¤Äʬ¤ÎÀßÄ꤬½ÐÍè¤Þ¤¹¡£
¡¡From ¤ÎÉôʬ¤ËÀÚ¤êÂؤ¨Á°¤Î Virtual Camera ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¢
To Éôʬ¤ËÀÚ¤êÂؤ¨¸å¤Î Virtual Camera ¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Î¥¢¥¿¥Ã¥Á¤µ¤ì¤Æ¤¤¤ë¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ò¥Ò¥¨¥é¥ë¥¡¼¤è¤ê¥¢¥µ¥¤¥ó¤·¤Þ¤¹¡£
From ¢ª To ¤Î´Ø·¸¤Ç¤¹¡£
¡¡Style ¤Ï Blend ¤ËÍøÍѤ¹¤ë Ease ¤ÎÀßÄê¡¢Time ¤Ï¥È¥é¥ó¥¸¥·¥ç¥ó¤Ë¤«¤«¤ë»þ´Ö(Éÿô)¤Ç¤¹¡£
ÀßÄê¸å¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
Cinemachine Blender Settings ¥¢¥»¥Ã¥È¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡¤³¤³¤Ç¥¢¥µ¥¤¥ó¤·¤Æ¤¤¤ë¾ðÊó¤Ï¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î̾Á°¤Ëɳ¤Å¤¤¤Æ¤¤¤Þ¤¹(¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó)¤Î¤Ç¡¢
Virtual Camera ¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î̾Á°¤¬Êѹ¹¤Ë¤Ê¤ë¤È¥¢¥µ¥¤¥ó¤¬³°¤ì¤Þ¤¹¡£
¡¡¤Þ¤º¡¢°Ê²¼¤Îusing¥¹¥Æ¡¼¥È¥á¥ó¥È¤òÄɲä·¤Þ¤¹¡£
using Cinemachine;
¡¡Cinemachine ¤Ç°·¤¦¾ðÊó¤ò¥¹¥¯¥ê¥×¥ÈÆâ¤Ëµ½Ò½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
¡¡¼¡¤Ë¡¢Ê£¿ô¤Î Virtual Camera¤ò³ÊǼ¤¹¤ë¤¿¤á¤ÎÇÛÎóÊÑ¿ô¤òºîÀ®¤·¤Þ¤¹¡£
¤³¤ì¤Ë¤è¤ê¡¢CinemachineVirtualCameraBase·¿¤ÎÇÛÎó¤Ç¤¢¤ëvirtualCameras¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£
[SerializeField] private CinemachineVirtualCameraBase[] virtualCameras;
¡¡¤¹¤Ù¤Æ¤Î Virtual Camera ¤Ï CinemachineVirtualCameraBase ¥¯¥é¥¹¤ò·Ñ¾µ¤·¤ÆºîÀ®¤µ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢
¤É¤Î¤è¤¦¤Ê¥¿¥¤¥×¤Î Virtual Camera ¤Ç¤â¥¢¥µ¥¤¥ó¤Ç¤¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
¡¡Virtual Camera¤Î¿ô¤Ë±þ¤¸¤Æ¡¢¤³¤ÎÇÛÎó¤ò½é´ü²½¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
º£²ó¤Ï SerializeField °À¤òÉÕÍ¿¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤Ë¤Æ½é´ü²½¤·¡¢Ê£¿ô¤Î Virtual Camera ¤ò¥¢¥µ¥¤¥ó¤·¤Æ¤ª¤¤Þ¤¹¡£
¡¡¼¡¤Ë¡¢ÀÚ¤êÂؤ¨¤¿¤¤ Virtual Camera ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ØÄꤹ¤ë¤¿¤á¤ÎÊÑ¿ô¤òºîÀ®¤·¤Þ¤¹¡£
private int currentCameraIndex;
¡¡currentCameraIndex ÊÑ¿ô¤Ï¡¢¸½ºßÍøÍѤ·¤Æ¤¤¤ë Virtual Camera ¤Î¾ðÊó¤ò¡¢ÇÛÎóÊÑ¿ô¤Î¾ðÊó¤Èɳ¤Å¤±¤Æ¤·¤ÆÍøÍѤ¹¤ë¤¿¤á¤Î
¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊÝ»ý¤¹¤ë¤¿¤á¤ÎÀ°¿ô·¿ÊÑ¿ô¤Ç¤¹¡£
¡¡ºÇ¸å¤Ë¡¢Virtual Camera¤òÀÚ¤êÂؤ¨¤ë¤¿¤á¤Î¥á¥½¥Ã¥É¤òºîÀ®¤·¤Þ¤¹¡£
public void SwitchCamera(int nextCameraIndex) { ¡¡¡¡// ¸½ºß¤ÎVirtual Camera¤ÎPriority¤ò²¼¤²¤ë virtualCameras[currentCameraIndex].Priority = inactiveCameraPriority; // ¿·¤·¤¤Virtual Camera¤ÎPriority¤ò¾å¤²¤ë virtualCameras[nextCameraIndex].Priority = activeCameraPriority; // currentCameraIndex¤ò¹¹¿·¤¹¤ë currentCameraIndex = nextCameraIndex; }
¡¡¤³¤Î½èÍý¤Ë¤è¤ê¡¢¸½ºß¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ØÄꤷ¤Æ¡¢¤½¤Î¥«¥á¥é¤Î Priprity ¤ò²¼¤²¤Æ̵¸ú²½¤·¡¢
¿·¤·¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ØÄꤷ¤Æ¡¢¤½¤Î¥«¥á¥é¤Î Priprity ¤ò¾å¤²¤Æ͸ú²½¤·¤Æ¤¤¤Þ¤¹¡£
¡¡¤³¤Î¥á¥½¥Ã¥É¤ò³°Éô¤Î¥¯¥é¥¹¤«¤é¼Â¹Ô¤·¡¢°ú¿ô¤Ç»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤ÎÇÛÎó¤ËÂåÆþ¤µ¤ì¤Æ¤¤¤ë Virtual Camera ¤ËÀÚ¤êÂؤ¨¤Þ¤¹
¡¡¥Ò¥¨¥é¥ë¥¡¼¤Î¶õ¤¤¤Æ¤¤¤ë¾ì½ê¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤ò³«¤¡¢Create Empty ¤ò¤·¤Æ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¤Þ¤¹¡£
̾Á°¤ò CameraSwitcher ¤ËÊѹ¹¤·¡¢ºîÀ®¤·¤¿ CameraSwitcher ¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡ÇÛÎóÊÑ¿ô¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤½¤Á¤é¤ËÀÚ¤êÂؤ¨¤¿¤¤ Virtual Camera ¤ò¥¢¥µ¥¤¥ó¤·¤ÆÅÐÏ¿¤·¤Þ¤¹¡£
¤³¤ÎÎã¤Ç¤Ï£²¤Ä¤Î¥«¥á¥é¤ò¥¢¥µ¥¤¥ó¤·¤Æ¤¤¤Þ¤¹¡£
¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü
¡¡Virtual Camera ¤òÁý¸º¤·¤¿¾ì¹ç¡¢¤³¤Á¤é¤ÎÇÛÎó¤Î¥¢¥µ¥¤¥ó¤âÊѹ¹¤¹¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡Ç¤°Õ¤Î¥¯¥é¥¹¤Ë¡¢CameraSwitcher ¥¯¥é¥¹¤òÍøÍѤǤ¤ë¾õÂ֤ˤ·¡¢Ç¤°Õ¤Î¥¿¥¤¥ß¥ó¥°¤Ç SwitchCamera ¥á¥½¥Ã¥É¤ò¼Â¹Ô¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£
¡Ê¤³¤ÎÀâÌÀ¤Ç½ñ¤«¤ì¤Æ¤¤¤ëÆâÍƤ¬Æñ¤·¤¯¡¢½èÍý¤ò¼ÂÁõ¤Ç¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢³°Éô¥¯¥é¥¹¤Î¥á¥½¥Ã¥É¤ò¼Â¹Ô¤¹¤ëÊýË¡¤Ë¤Ä¤¤¤ÆÉü½¬¤ò¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£¡Ë
¡¡»ØÄꤷ¤¿°ú¿ô¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¥«¥á¥é¤ËÀÚ¤êÂؤï¤ì¤ÐÀµ¾ï¤ËÆ°ºî¤·¤Æ¤¤¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¡¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡Custom Blends ¤òÍøÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥È¥é¥ó¥¸¥·¥ç¥ó¤Î»þ´Ö¤ä Style ¤Ê¤É¤òÊѹ¹¤·¡¢¥«¥á¥é¤ÎÀÚ¤êÂؤï¤ê½èÍý¤¬¤É¤Î¤è¤¦¤ËÊѲ½¤¹¤ë¤«¤ò³Îǧ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
¤³¤ÎÎã¤Ç¤Ï¥È¥é¥ó¥¸¥·¥ç¥ó¤Î»þ´Ö¤ò2É䫤é1ÉäËÊѹ¹¤·¤Æ¤¤¤Þ¤¹¡£
¡ã¼ÂÁõÆ°²è¢¡ä
Æ°²è¥Õ¥¡¥¤¥ë¤Ø¤Î¥ê¥ó¥¯
¡¡°Ê¾å¤Ë¤Ê¤ê¤Þ¤¹¡£
- ¥«¥Æ¥´¥ê¡§
- ¿Ê³Ø/¥¹¥¯¡¼¥ë
- ¥×¥í¥°¥é¥ß¥ó¥°
¥³¥á¥ó¥È¤ò¤«¤¯