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

¡¼Skybox¤Î¼«Æ°Êѹ¹½èÍý¤Î¼ÂÁõ¡¼


¡ãSkyybox¡¡ÀßÄê¤Ê¤·(Default)¡ä



¡ãSkyybox¡¡ÀßÄꤢ¤ê¡ä



¡¡¡¦Skybox¤Î¼«Æ°Êѹ¹½èÍý¤Î¼ÂÁõ


¡ã¼ÂÁõÆ°²è¡¡¥²¡¼¥à¤ò¼Â¹Ô¤¹¤ë¤¿¤Ó¤Ë Skybox ¤¬¥é¥ó¥À¥à¤ËÀßÄꤵ¤ì¤ë¡ä
https://gyazo.com/836b133d85f3fd88b3aa6ba7711f1745



¡¡¿·¤·¤¤³Ø½¬ÆâÍƤϡ¢°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£

¡¡¡¦Skybox
¡¡¡¦RenderSettings.skybox ÊÑ¿ô


£±¡¥Skybox ¤Ë¤Ä¤¤¤Æ


¡¡Unity ¤Ç¤Ï Skybox ¤È¤¤¤¦±ó·Ê¤Ë¸«¤¨¤ë¶õ¤ÎÇطʲèÁü¤òÀßÄê¤Ç¤­¤Þ¤¹¡£

¡¡ÀßÄê¾ì½ê¤Ï Lighting ¤È¤¤¤¦¥¦¥¤¥ó¥É¥¦¤Ë¤¢¤ê¤Þ¤¹¡£
Lighting ¥¦¥¤¥ó¥É¥¦¤Ï¡¢º¸¾å¤Î¥á¥Ë¥å¡¼¤ÎÃ椫¤é¡¢Window => Rendering => Lighting ¤òÁªÂò¤¹¤ë¤³¤È¤Ç³«¤­¤Þ¤¹¡£


Lighting ¥¦¥¤¥ó¥É¥¦



¡¡Lighting ¥¦¥¤¥ó¥É¥¦Æâ¤Î Environment ¥¿¥Ö¤ò²¡¤¹¤È¡¢Skybox ¤ÎÀßÄê¤ò¹Ô¤¦ÆâÍƤËÀÚ¤êÂؤï¤ê¤Þ¤¹¡£


Lighting ¥¦¥¤¥ó¥É¥¦¡¡Environment ¥¿¥Ö



¡¡Skybox Material ¤È¤¤¤¦Éôʬ¤¬ÀßÄê¹àÌܤˤʤê¤Þ¤¹¡£Material ¤È¤¤¤¦Ì¾Á°¤ÎÄ̤ꡢSkybox ¤ÎÀßÄê¤Ë¤Ï¥Þ¥Æ¥ê¥¢¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£

¡¡½é´üÃÍ¤Ï Default skybox ¤È¤¤¤¦¥Þ¥Æ¥ê¥¢¥ë¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£
¤³¤ÎÉôʬ¤òÀßÄꤹ¤ë¤³¤È¤Ç Skybox ¤òÊѹ¹¤Ç¤­¤Þ¤¹¡£¼«Í³¤Ê¤â¤Î¤ËÀßÄꤷ¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£¶õ¤ÎÇطʤ¬Êѹ¹¤Ë¤Ê¤ê¤Þ¤¹¡£

¡¡¤³¤Î¼ê½ç¤Ç¤Ï¡¢¤³¤Î Skybox ¤ÎÀßÄê¤ò¥¹¥¯¥ê¥×¥È¤«¤éÁàºî¤·¡¢¥¹¥¯¥ê¥×¥ÈÆâ¤Ë»öÁ°¤ËÅÐÏ¿¤·¤Æ¤¢¤ë¥Þ¥Æ¥ê¥¢¥ë¤ËÊѹ¹¤¹¤ëÀ©¸æ¤ò¹Ô¤¤¤Þ¤¹¡£


£²¡¥Àß·×


¡¡Skybox ¤ÎÀßÄê¤òÊѹ¹¤¹¤ë¾ì½ê¤Ïʬ¤«¤ê¤Þ¤·¤¿¡£

¡¡Skybox ¤Ï̵ÎÁ¤Î¥¢¥»¥Ã¥È¤òÍøÍѤ·¤Æ¥¤¥ó¥Ý¡¼¥È¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¤Î¤Ç¡¢
¤Þ¤º¤ÏºÇ½é¤Ë¡¢Skybox ¤ò Unity ¤Ë¥¤¥ó¥Ý¡¼¥È¤·¤Æ¡¢¿§¡¹¤Ê Skybox ¤ËÊѹ¹½ÐÍè¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£

¡¡¤½¤Î¸å¡¢Skybox ¤òÊѹ¹¤¹¤ë¤¿¤á¤Î SkyboxChanger ¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¡¢¤½¤ÎÃæ¤Ë Skybox ¤ËÍøÍѤ·¤¿¤¤¥Þ¥Æ¥ê¥¢¥ë¤òÅÐÏ¿¤·¤Þ¤¹¡£
¤½¤·¤Æ¡¢ Skybox ¤òÊѹ¹¤¹¤ë¥á¥½¥Ã¥É¤òÍÑ°Õ¤·¤Þ¤¹¡£¤³¤Î¥á¥½¥Ã¥É¤ò³°Éô¤Î¥¹¥¯¥ê¥×¥È¤«¤é¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤ê¡¢
ÅÐÏ¿¤·¤¿¥Þ¥Æ¥ê¥¢¥ë¤ò Skybox ¤ËŬÍѤ·¤ÆÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡£

¡¡SkyboxChanger ¥¹¥¯¥ê¥×¥È¤Î Skybox ¤òÊѹ¹¤¹¤ë¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¤Î¤Ï¡¢¥²¡¼¥à¤Î´ÉÍý¤ò¹Ô¤Ã¤Æ¤¤¤ë GameManager ¥¹¥¯¥ê¥×¥È¤Ë¹Ô¤ï¤»¤Þ¤¹¡£

¡¡¿·¤·¤¯ Awake ¥á¥½¥Ã¥É¤òÍÑ°Õ¤·¡¢¤½¤ÎÃæ¤Ç Skybox ¤ÎÊѹ¹¤ò¹Ô¤¦¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤·¤ÆÊѹ¹¤ò¹Ô¤¤¤Þ¤¹¡£
Awake ¥á¥½¥Ã¥É¤Ï Start ¥á¥½¥Ã¥É¤è¤ê¤â½èÍý¤ò¹Ô¤¦¤Î¤¬Áᤤ¥á¥½¥Ã¥É¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢
¥²¡¼¥à¤ò¼Â¹Ô¤¹¤ë¤È¾¤Î½èÍý¤è¤ê¤âÁ᤯¡¢Skybox ¤ÎÊѹ¹¤¬¹Ô¤ï¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£


£³¡¥Skybox ¤Î¥¢¥»¥Ã¥È¤ò¥¤¥ó¥Ý¡¼¥È¤¹¤ë


¡¡¤³¤³¤Ç¤Ï£²¼ïÎà¤Î̵ÎÁ¥¢¥»¥Ã¥È¤ò¾Ò²ð¤·¤Þ¤¹¡£
¥¢¥»¥Ã¥È¥¹¥È¥¢¤ò¸¡º÷¤·¤Æ¤¤¤¿¤À¤¯¤È¾¤Ë¤â̵ÎÁ¤Î Skybox ¤Ï¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢Â¾¤Î¥¢¥»¥Ã¥È¤òÍøÍѤ·¤Æ¤¤¤¿¤À¤¤¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£

¡¡£±¡¥SkySphere Volume 1
¡¡£²¡¥Fantasy Skybox FREE



¡¡¥¢¥»¥Ã¥È¥¹¥È¥¢¤Ø°ÜÆ°¤·¤Æ¡¢¾åµ­¤Î¥¢¥»¥Ã¥È¤Î̾Á°¤Ç¸¡º÷¤ò¤·¤Æ¤¯¤À¤µ¤¤¡£ÂоݤΥ¢¥»¥Ã¥È¤¬¸«¤Ä¤«¤ê¤Þ¤¹¡£


SkySphere Volume 1



¡¡¤³¤Î¥¢¥»¥Ã¥È¤ò¥¯¥ê¥Ã¥¯¤¹¤ë¤È¥¢¥»¥Ã¥È¤Î¾ÜºÙ¤¬²èÌ̤Ëɽ¼¨¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢ ²èÌ̤α¦Â¦¤Ë¤¢¤ë Add to My Assets ¤È¤¤¤¦ÀĤ¤¥Ü¥¿¥ó¤ò²¡¤·¤Þ¤¹¡£





¡¡Unity¤Î¥¢¥«¥¦¥ó¥È¤Ç¤Î¥µ¥¤¥ó¥¤¥ó¤òµá¤á¤é¤ì¤Þ¤¹¤Î¤Ç¡¢¼«Ê¬¤Î¥¢¥«¥¦¥ó¥È¤òÍøÍѤ·¤Æ¥¹¥È¥¢¤Ø¥µ¥¤¥ó¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£
¡¡
¡¡ºÆÅÙ¥Ú¡¼¥¸¤¬Æɤ߹þ¤Þ¤ì¤Æ¡¢Àè¤Û¤É¤Î¥Ü¥¿¥ó¤Î¥á¥Ã¥»¡¼¥¸¤¬ÊѤï¤ê¡¢ Open in Unity ¤È¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢¤Þ¤¿¤³¤ÎÀĤ¤¥Ü¥¿¥ó¤ò²¡¤·¤Þ¤¹¡£
¤¢¤ë¤¤¤Ï¡¢²èÌ̤ξåÉô¤Ë¥¦¥¤¥ó¥É¥¦¤¬É½¼¨¤µ¤ì¤Æ¡¢¤½¤ÎÃæ¤Ë Open in Unity ¤Î¥Ü¥¿¥ó¤¬¤¢¤ê¤Þ¤¹¤Î¤Ç²¡¤·¤Þ¤¹¡£

¡¡¼«Æ°Åª¤ËUnity¤Î¥¨¥Ç¥£¥¿¡¼²èÌ̤ËÁ«°Ü¤·¤Þ¤¹¡£¥µ¥¤¥È¤Ï¤Þ¤¿¸å¤Ç¾¤Î¥¢¥»¥Ã¥È¤Î¥À¥¦¥ó¥í¡¼¥É¤ËÍøÍѤ¹¤ë¤Î¤Ç¡¢¤½¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£



¡¡¥¨¥Ç¥£¥¿¡¼¤ÎPackageManager¥Ó¥å¡¼¤¬³«¤¤¤Æ¡¢ÂоݤΥ¢¥»¥Ã¥È¤¬É½¼¨¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢±¦²¼¤Ë¤¢¤ë Download ¥Ü¥¿¥ó¤ò²¡¤·¤Þ¤¹¡£

PackageManager¥Ó¥å¡¼­¡¡¡Download



¡¡Download ¤¬½ªÎ»¤¹¤ë¤Èº¸Î٤ˤ¢¤ë Import ¤È¤¤¤¦¥Ü¥¿¥ó¤¬²¡¤»¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢¤½¤Á¤é¤ò²¡¤·¤Þ¤¹¡£

PackageManager¥Ó¥å¡¼­¢¡¡Import


¡¡
¡¡¥¤¥ó¥Ý¡¼¥È¤¹¤ë¥¢¥»¥Ã¥È¤Î°ìÍ÷¤¬¥Ý¥Ã¥×¥¢¥Ã¥×¥¦¥¤¥ó¥É¥¦¤È¤·¤Æɽ¼¨¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢¤½¤Î¤Þ¤Þ±¦²¼¤Ë¤¢¤ë Import ¥Ü¥¿¥ó¤ò²¡¤·¤Þ¤¹¡£


Import³Îǧ¤Î¥Ý¥Ã¥×¥¢¥Ã¥×



¡¡ÂÔµ¡¤¹¤ë¤è¤¦¤Ë¥×¥í¥°¥ì¥¹É½¼¨¤¬½Ð¤Æ¡¢¤·¤Ð¤é¤¯¤¹¤ë¤È¥¢¥»¥Ã¥È¤Î¥¤¥ó¥Ý¡¼¥È¤¬½ªÎ»¤·¤Þ¤¹¡£


¡¡ProjectÆâ¤ò³Îǧ¤·¤Þ¤·¤ç¤¦¡£AlignedGames ¤È¤¤¤¦¿·¤·¤¤¥Õ¥©¥ë¥À¤¬Äɲ䵤ì¤Æ¤¤¤ì¤Ð̵»ö¤Ë¥¤¥ó¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
¥Õ¥©¥ë¥À¤ò½çÈ֤˳«¤¤¤Æ¤¤¤¯¤È¡¢SkySphere_V1 ¥Õ¥©¥ë¥À¤¬¤¢¤ê¡¢¤½¤ÎÃæ¤Ë¤¿¤¯¤µ¤ó¤Î¥Õ¥©¥ë¥À¤È¥Õ¥¡¥¤¥ë¤¬Äɲ䵤ì¤Æ¤¤¤Þ¤¹¡£


SkySphere_V1



¡¡¤³¤ì¤Ç£±¤ÄÌܤΥ¢¥»¥Ã¥È¤Î¥¤¥ó¥Ý¡¼¥È¤Ï´°Î»¤Ç¤¹¡£



¡¡£²¤ÄÌܤΥ¢¥»¥Ã¥È¤âƱ¤¸¼ê½ç¤Ç¥À¥¦¥ó¥í¡¼¥É¤·¡¢¥¤¥ó¥Ý¡¼¥È¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£


Fantasy Skybox FREE



¡¡¥¤¥ó¥Ý¡¼¥È¸å¤Î¥Õ¥©¥ë¥À¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£


Fantasy Skybox FREE



¡¡°Ê¾å¤Ç¥¢¥»¥Ã¥È¤Î¥¤¥ó¥Ý¡¼¥È¤Ï´°Î»¤Ç¤¹¡£

¡¡Àè¤Û¤É¤Î Lighting ¥¦¥¤¥ó¥É¥¦¤ò³«¤¤¤Æ¡¢¥¤¥ó¥Ý¡¼¥È¤·¤¿ Skybox ÍѤΥޥƥꥢ¥ë¤òÀßÄꤷ¤Æ¤ß¤Þ¤·¤ç¤¦¡£

¡¡¿§¡¹¤Ê¥Þ¥Æ¥ê¥¢¥ë¤ò»î¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£¼¡¤Î¼ê½ç¤Ç Skybox ¤Î¥Þ¥Æ¥ê¥¢¥ë¤òÊѹ¹¤¹¤ë¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤Þ¤¹¤¬
¤½¤³¤Ë¡¢Êѹ¹¤·¤¿¤¤¥Þ¥Æ¥ê¥¢¥ë¤ò¿ô¸ÄÅÐÏ¿¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£

¡¡ÀßÄꤷ¤¿ Skybox ¤Ï¤½¤Î¤Þ¤Þ¤Ç¤â¤è¤¤¤Ç¤¹¤·¡¢Default skybox ¤ËÌᤷ¤Æ¤¤¤¿¤À¤¤¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£


£´¡¥SkyboxChanger ¥¹¥¯¥ê¥×¥È¤òºîÀ®¤¹¤ë


¡¡¿·¤·¤¤ SkyboxChanger ¥¹¥¯¥ê¥×¥È¤òºîÀ®¤·¤Þ¤¹¡£

¡¡¤³¤Î¥¹¥¯¥ê¥×¥È¤Ç¤Ï¥á¥½¥Ã¥É¤òÍÑ°Õ¤·¡¢¤½¤Î¥á¥½¥Ã¥É¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢Lighting ¥¦¥¤¥ó¥É¥¦¤Î Skybox Material ¤Î¹àÌܤò¡¢¥¹¥¯¥ê¥×¥È¤«¤éÊѹ¹¤·¤ÆÀ©¸æ¤ò¹Ô¤¤¤Þ¤¹¡£

¡¡Skybox Material ¤Ë¤Ï¥Þ¥Æ¥ê¥¢¥ë¤ò»ØÄꤹ¤ë¤¿¤á¡¢Material ·¿¤ÎÇÛÎóÊÑ¿ô¤òÍÑ°Õ¤·¡¢»öÁ°¤ËÅÐÏ¿¤ò¤·¤Æ¤ª¤­¡¢¤³¤ÎÃͤòÍøÍѤ·¤ÆÊѹ¹¤¹¤ë¥Þ¥Æ¥ê¥¢¥ë¤ò»ØÄꤷ¤Þ¤¹¡£
SerializeField°À­¤ÇÀë¸À¤·¤Æ¤ª¤¯¤³¤È¤Ç¡¢¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤«¤é¹¥¤­¤Ê¿ô¤Î¥Þ¥Æ¥ê¥¢¥ë¤òÅÐÏ¿¤Ç¤­¤ë¤è¤¦¤ËÀ߷פ·¤Æ¤ª¤­¤Þ¤¹¡£


SkyboxChanger.cs

¡¡<=¡¡¥¯¥ê¥Ã¥¯¤¹¤ë¤È³«¤­¤Þ¤¹¡£



£µ¡¥¡ãRenderSettings.skybox ÊÑ¿ô¡ä


¡¡Skybox ¤Ï¥Þ¥Æ¥ê¥¢¥ë¤Ë¤è¤Ã¤ÆÀßÄꤵ¤ì¤Æ¤¤¤ë¤¿¤á¡¢Å¬ÍѤ¹¤ë¤¿¤á¤Î¥Þ¥Æ¥ê¥¢¥ë¤òÍÑ°Õ¤·¤Æ RenderSettings.skybox ÊÑ¿ô¤òÍøÍѤ¹¤ë¤³¤È¤Ç¡¢
¥¹¥¯¥ê¥×¥È¤«¤éưŪ¤Ë Skybox ¤ÎÊѹ¹¤¬²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£

  // Skybox ¤ò»ØÄꤵ¤ì¤¿Í×ÁÇÈÖ¹æ¤Î¥Þ¥Æ¥ê¥¢¥ë¤Î Skybox ¤ËÊѹ¹
  RenderSettings.skybox = skyboxMaterials[skyboxMaterialsIndex];


»²¹Í¥µ¥¤¥È
Unity¸ø¼°¥¹¥¯¥ê¥×¥È¥ê¥Õ¥¡¥ì¥ó¥¹
RenderSettings.skybox
https://docs.unity3d.com/ja/2018.4/ScriptReference...


£¶¡¥SkyboxChanger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òºîÀ®¤·¤Æ¡¢SkyboxChanger ¥¹¥¯¥ê¥×¥È¤ò¥¢¥¿¥Ã¥Á¤·¡¢ÀßÄê¤ò¹Ô¤¦


¡¡¥Ò¥¨¥é¥ë¥­¡¼¤Î²¿¤â¤Ê¤¤¾ì½ê¤Ç±¦¥¯¥ê¥Ã¥¯¤ò¤·¤Æ¥á¥Ë¥å¡¼¤ò³«¤­¡¢Create Empty ¤òÁªÂò¤·¤Þ¤¹¡£
¿·¤·¤¤¶õ¤Î¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤¬ºîÀ®¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢Ì¾Á°¤ò SkyboxChanger ¤ËÊѹ¹¤·¤Þ¤¹¡£


¥Ò¥¨¥é¥ë¥­¡¼²èÁü



¡¡ºîÀ®¤·¤Æ¤¢¤ë SkyboxChanger ¥¹¥¯¥ê¥×¥È¤ò¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¡¢SkyboxChanger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¢¥¿¥Ã¥Á¤·¤Þ¤¹¡£


SkyboxChanger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü




¡¡SkyboxChanger ¥¹¥¯¥ê¥×¥È¤Î skyboxMaterials ÊÑ¿ô¤Î Size ¤ò 0 ¤«¤é¹¥¤­¤Ê¿ô¤ËÊѹ¹¤·¤Þ¤¹¡£
¤³¤ÎÃͤÎʬ¤À¤±¡¢Skybox ÍѤΥޥƥꥢ¥ë¤ÎÅÐÏ¿¤¬½ÐÍè¤Þ¤¹¡£¤³¤³¤Ç¤Ï 4 ¤ËÀßÄꤷ¤Æ¤¤¤Þ¤¹¡£


Size 0



¡¡Size ¤òÊѹ¹¤¹¤ë¤È¡¢ÇÛÎó¤ÎÍ×ÁǤòÅÐÏ¿¤¹¤ë¤¿¤á¤Î Element ¤¬Äɲ䵤ì¤Þ¤¹¡£
Í×ÁÇÈÖ¹æ¤Ï 0 ¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£


Size 4 ¤ËÊѹ¹¡¡Element ¤¬É½¼¨¤µ¤ì¤ë



¡¡³Æ Element ¤Ë¥¤¥ó¥Ý¡¼¥È¤·¤¿ Skybox ¤Î¥¢¥»¥Ã¥È¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Þ¥Æ¥ê¥¢¥ë¤ò¼«Í³¤ËÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£


¥Õ¥©¥ë¥À


¥Õ¥©¥ë¥À



ÅÐÏ¿Îã¡¡SkyboxChanger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü



¡¡°Ê¾å¤Ç Skybox Êѹ¹ÍѤÎÀßÄê¤Ï´°À®¤Ç¤¹¡£
³¤¤¤Æ¡¢Skybox ¤òÊѹ¹¤¹¤ë¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹½èÍý¤ò GameManager ¥¹¥¯¥ê¥×¥È¤ËÄɲä·¤Þ¤¹¡£


£·¡¥GameManager ¥¹¥¯¥ê¥×¥È¤Î½¤Àµ¤ò¹Ô¤¤¡¢¹âÅÙɽ¼¨ÍѤΥ­¥ã¥é¤Î¥¢¥¤¥³¥ó¤È¥­¥ã¥é¤Î°ÌÃ֤ȤòƱ´ü¤µ¤»¤ë


¡¡Àë¸À¥Õ¥£¡¼¥ë¥É¤Ë SkyboxChanger ·¿¤ÎÊÑ¿ô¤òÍÑ°Õ¤·¤Þ¤¹¡£SerializeField°À­¤ÇÀë¸À¤·¤Æ¤ª¤¯¤³¤È¤Ç¡¢¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤è¤êÃͤÎÅÐÏ¿¤¬²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£
SkyboxChanger ¥¹¥¯¥ê¥×¥È¤Ë¤Ï Skybox ¤òÊѹ¹¤¹¤ë¥á¥½¥Ã¥É¤¬ÍÑ°Õ¤·¤Æ¤¢¤ê¤Þ¤¹¤Î¤Ç¡¢¤³¤ÎÊÑ¿ô¤Ï¤½¤ÎÌ¿Îá¤ò¼Â¹Ô¤µ¤»¤ë¤¿¤á¤ËɬÍפʾðÊó¤Ç¤¹¡£

¡¡¿·¤·¤¤¥á¥½¥Ã¥É¤È¤·¤Æ Awake ¥á¥½¥Ã¥É¤òÄɲä·¤Þ¤¹¡£
¡¡¡¡
¡¡Awake ¥á¥½¥Ã¥É¤Ï Start ¥á¥½¥Ã¥É¤è¤ê¤âÁ᤯¼Â¹Ô¤µ¤ì¤ë Unity ¤¬°·¤¦¥á¥½¥Ã¥É¤Ç¤¹¡£
Start ¥á¥½¥Ã¥É¤è¤ê¤â½èÍý¤¬Áᤤ¤¿¤á¡¢¤³¤Î¥á¥½¥Ã¥É¤ÎÃæ¤Ç Skybox ¤òÊѹ¹¤¹¤ëÌ¿Îá¤ò¼Â¹Ô¤·¤Þ¤¹¡£
¤½¤¦¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¥²¡¼¥à³«»Ï»þ¤Ë¤Ï Skybox ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾õÂ֤ˤʤê¤Þ¤¹¡£

¡¡¥×¥í¥°¥é¥à¤Î½èÍý¤Î½çÈÖ¤ÏÈó¾ï¤ËÂçÀڤǤ¹¡£¤³¤¦¤¤¤Ã¤¿¡¢¤É¤Î¥¿¥¤¥ß¥ó¥°¤Ç¤É¤Î½èÍý¤ò¤¹¤ì¤Ð¤è¤¤¤«¡¢¤È¤¤¤¦¤³¤È¤Ï
¥í¥¸¥Ã¥¯¤òÁȤàºÝ¤Ë°ì½ï¤Ë¹Í¤¨¤Æ¤ª¤¯¤³¤È¤¬½ÅÍפǤ¹¡£


GameManager.cs(¼«Ê¬¤ÇºîÀ®¤·¤Æ¤¤¤ë¥¹¥¯¥ê¥×¥È¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¥¹¥¯¥ê¥×¥È¤ò½¤Àµ¤¹¤ë)

¡¡<=¡¡¥¯¥ê¥Ã¥¯¤¹¤ë¤È³«¤­¤Þ¤¹



¡¡¥¹¥¯¥ê¥×¥È¤Î½¤Àµ¤¬½ªÎ»¤·¤¿¤é¡¢GameManager ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¤¥ó¥¹¥Ú¥¯¥¿¡¼¤è¤ê¡¢GameManager ¥¹¥¯¥ê¥×¥È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
¿·¤·¤¯Àë¸À¤·¤ÆÄɲä·¤¿ÊÑ¿ô¤¬É½¼¨¤µ¤ì¤Æ¤¤¤ì¤ÐÌäÂꤢ¤ê¤Þ¤»¤ó¡£


GameManager ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü



£¸¡¥GameManager ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀßÄê¤ò¹Ô¤¦


¡¡¥Ò¥¨¥é¥ë¥­¡¼¤Ë¤¢¤ë SkyboxChanger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤òÁªÂò¤·¤Æ¡¢skyboxChanger ÊÑ¿ô¤Ø¥É¥é¥Ã¥°¥¢¥ó¥É¥É¥í¥Ã¥×¤·¤Æ¥¢¥µ¥¤¥ó¤·¤Æ¤¯¤À¤µ¤¤¡£
¼«Æ°Åª¤Ë¡¢SkyboxChanger ¥¹¥¯¥ê¥×¥È¤¬ÅÐÏ¿¤µ¤ì¤Þ¤¹¡£


GameManager ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü



£¹¡¥¥²¡¼¥à¤ò¼Â¹Ô¤·¤ÆÆ°ºî¤ò³Îǧ¤¹¤ë


¡¡¤¹¤Ù¤Æ¤Î¼ê½ç¤¬´°À®¤·¤Þ¤·¤¿¤Î¤Ç¡¢¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
Skybox ¤ÎÀßÄ꤬¡¢SkyboxChanger ¥¹¥¯¥ê¥×¥È¤Ç»ØÄꤷ¤Æ¤¤¤ëÍ×ÁÇÈÖ¹æ¤Î¥Þ¥Æ¥ê¥¢¥ë¤ËÊѹ¹¤µ¤ì¤ì¤ÐÀ®¸ù¤Ç¤¹¡£

¡¡Í×ÁÇÈÖ¹æ¤Ï Element ¤ÎÈÖ¹æ¤ÈÂбþ¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢0 ¡Á 3 ¤Þ¤Ç¤ÎÃͤò½çÈÖ¤ËÆþ¤ì¤Æ¡¢
¤½¤ÎÈÖ¹æ¤Î¥Þ¥Æ¥ê¥¢¥ë¤Ë¤Ê¤ë¤«¤É¤¦¤«¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£


¡ã¼Â¹ÔÆ°²è¡¡Skybox ¤Ë»ØÄꤷ¤¿Í×ÁÇÈÖ¹æ¤Î¥Þ¥Æ¥ê¥¢¥ë¤¬ÀßÄꤵ¤ì¤ë¡ä
https://gyazo.com/836b133d85f3fd88b3aa6ba7711f1745



¡¡Â³¤¤¤Æ¡¢SkyboxChanger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¤Î SkyboxChanger ¥¹¥¯¥ê¥×¥È¤ò³Îǧ¤·¡¢skyboxMaterilasIndex ÊÑ¿ô¤ÎÃͤò 999 ¤ËÊѹ¹¤·¤Þ¤¹¡£
¤³¤ÎÃͤ¬ 999 ¤ËÀßÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢¥¹¥¯¥ê¥×¥È¤ÎÀ©¸æ¤Ë¤è¤ê¡¢Skybox ¤ÎÀßÄ꤬¥²¡¼¥à¼Â¹Ô¤Î¤¿¤Ó¤Ë¡¢skyboxMaterilas ÊÑ¿ô¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÈÏ°ÏÆâ¤Ç¥é¥ó¥À¥à¤ËÊѹ¹¤µ¤ì¤Þ¤¹¡£
º£²ó¤Î¾ì¹ç¤Ç¤¢¤ì¤Ð¡¢4¼ïÎà¤Î¥Þ¥Æ¥ê¥¢¥ë¤Î¤¦¤Á¤Î1¤Ä¤ËÊѹ¹¤µ¤ì¤Þ¤¹¡£²¿²ó¤«¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£


SkyboxChanger ¥²¡¼¥à¥ª¥Ö¥¸¥§¥¯¥È¡¡¥¤¥ó¥¹¥Ú¥¯¥¿¡¼²èÁü



¡ã¼Â¹ÔÆ°²è¡¡¥é¥ó¥À¥àÀßÄê¤Ë¤·¤Æ¥²¡¼¥à¤ò¼Â¹Ô¤·¤Æ³Îǧ¤¹¤ë¡ä
https://gyazo.com/cbbb207976860d57c4b0f8132c9e3222


¡¡°Ê¾å¤Ç¤³¤Î¼ê½ç¤Ï½ªÎ»¤Ç¤¹¡£

¡¡=>¡¡¼¡¤Ï¡¡È¯Å¸£µ¡¡¡¼ÀßÃÖ·¿¥¢¥¤¥Æ¥à¤Î¼ÂÁõ¡¼¡¡¤Ç¤¹¡£

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


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

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

Menu


´ðÁÃ

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

private



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

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