Unityã§å¤æ°ã®å¤ããã¬ãã¥ã¼ã§åæ ãããªãæã®è§£æ±ºæ³
Unity触ã£ã¦ã¾ã éããªãããããã¼æ©ãããã£ããã©ããããã£ã¨Unityéçºè ãããã話ã®ã²ã¨ã¤ãªãã ãããªãã
â»Unity4.5.3(C#) Windowsã§ç¢ºèª
Â
çºçããåé¡
ã¹ã¯ãªããä¸ã§å¤æ°ã®å¤ãå¤æ´ãã¦ãããªãããã¬ãã¥ã¼æã«ãã®å¤æ°ã®å¤ãåæ ãããªãã
åå
- Public宣è¨ãããå¤æ°ã®å ´åããã¬ãã¥ã¼æã¯ã¹ã¯ãªããä¸ã§åæåãããå¤æ°ãããUnity IDEä¸ã®Hierarcyå ã®åã¤ã³ã¹ãã¯ã¿ã«è¡¨ç¤ºãããå¤æ°ã®å¤ãåªå çã«é©ç¨ãããããã
- ããããEditorãã©ã«ãã使ã£ãã«ã¹ã¿ã UIã¹ã¯ãªãããå©ç¨ãã¦ããå ´åã¯ãã«ã¹ã¿ã UIã¹ã¯ãªããä¸ã§å®ç¾©ãããå¤æ°ãã表示ãããªãã
- 表示ããã¦ããªãã«ãé¢ããããå¤æ°ã®å¤ã¯ã¤ã³ã¹ãã¯ã¿å´ã§ä¿æãç¶ããï¼ï¼ï¼ã¨ããä»æ§ã®ããããã®ç¶æ ã§ã¹ã¯ãªããå´ã®Publicå¤æ°ã®å¤ãããã£ã¦ãããã¬ãã¥ã¼æã«ã¯è¦ããªãã¨ããã§ãã£ãã·ã¥ããã¦ããå¤ãåç §ããçµæçã«å¤æ°ã®å¤ãåæ ããã¦ãªãããã«è¦ãã¦ãã¾ãã
解決æ¹æ³
ã¤ã³ã¹ãã¯ã¿å´ã®å¤ããªãã¬ãã·ã¥ãã
ã¤ã³ã¹ãã¯ã¿ã®æ¯è»ã¢ã¤ã³ã³ï¼ç»åå ã®é»ç·å°ï¼ããResetãé¸æããã¨ãã¤ã³ã¹ãã¯ã¿ä¸ã®å¤æ°ããªãã¬ãã·ã¥ãããã¹ã¯ãªããä¸ã®å¤æ°ãåç §ãç´ãã¦ããã¾ãã
å¤æ´ãããå¤æ°ãã¤ã³ã¹ãã¯ã¿ä¸ã«è¡¨ç¤ºãã
Assetå ã®Scriptãã©ã«ãã¨åé層ã«ããEditorãã©ã«ãï¼ç»åå ã®èµ¤å°ï¼ãéãã¨ã«ã¹ã¿ã UIãå®ç¾©ãã¦ããã¹ã¯ãªãããç½®ãã¦ããã®ã§ãããã«èªåã追å ãããå¤æ°ã®å®ç¾©ã追è¨ãããã«ã¹ã¿ã UIã®å®ç¾©ã¨å¤æ´æ¹æ³ã¯ä»¥ä¸ã®ãµã¤ããåèã«ã©ããã
Â
Â
ãªããã¤ã³ã¹ãã¯ã¿ä¸ã«å¤æ°ã表示ããã¦ã常ã«å¤ããªãã¬ãã·ã¥ãã¦ãããã¯ã±ã§ã¯ãªãã®ã§ãæ¯è»ã¢ã¤ã³ã³ããã®Resetã¯çµå±å¿ è¦ã«ãªãã®ã§æ³¨æãã¦ãã ããã
Â
å¤æ°ãprivateã«ãã
å¤æ°ãprivateã«ããã°ã¤ã³ã¹ãã¯ã¿å´ã«å¤æ°ã¯å±éãããªããªãã®ã§ã常ã«ã¹ã¯ãªããå ã®å¤æ°ãåç §ãã¦ããã¾ãã
Â
Â
Oculusã§OVRãªãã¸ã§ã¯ãå ã®å¤æ°ã®å½¹å²ãææ¡ããããã«å¤ãå¤æ´ãã¦ãã¾ã£ããåæ ãããªãã£ããããããããªãã¨æã£ãããããªã¨ããã«åå ããã£ãã¨ã¯ï½¥ï½¥ï½¥ãUnityã£ã¦ç½ ãå¤ãã¨ãã触ãè¾¼ã¿ãã¡ããã¡ããè¦ããããã©ãè¦äºã«ç½ ãè¸ã¿æããæããããããã¯ã·ã§ã¼ã
Â
Â
Â