ã¯ã¦ãªããã°ã§Unityã½ã¼ã¹ã³ã¼ãã表示ããæé©è§£ã¯ï¼åãã¯ã¦ãªè¨æ³ãé¸æããçç±
ã2015å¹´7æã
ãã®ããã°ã«ã¯ããããã½ã¼ã¹ã³ã¼ããè¼ãã¦ãã¾ãããã½ã¼ã¹ã³ã¼ãã®è¡¨ç¤ºæ¹æ³ã«ã¯
Â
â GitHubã®Gistã使ã
â¡SyntaxHighlighterã使ã
â¢ã¯ã¦ãªè¨æ³ã使ã
Â
ã¨3ã¤ã®æ¹æ³ãããã¾ãã
è²ã ã¨è©¦ãã¦ã¿ãçµæãåã¯ã¯ã¦ãªè¨æ³ãé¸æãã¾ããã
Â
ã¯ã¦ãªããã°ã§æé©ãªã½ã¼ã¹ã³ã¼ã表示æ¹æ³ã¯ï¼åãã¯ã¦ãªè¨æ³ãé¸æããçç±
Â
â GitHubã®Gist
ã¾ãã¯GitHubã®Gist ã§ããtyoshikawa1106ã®ããã°æ§ãåèã«ãã¦ãGistã®ä½¿ãæ¹ã¯ã ãããææ¡ã§ãã¾ããã
Â
ã¯ã¦ãªããã°ã§ã¯ãã¡ãã¥ã¼ã®ä¸ã®ã»ãã«GitHubç¨ã®ã³ãã³ããããã®ã§ãããé¸æããGitHubã¦ã¼ã¶ã¼åãå ¥åãã¦é£æºãã¿ã³ãæ¼ãã¨ãã¯ã³ã¿ããã§Gistãæ¿å ¥ãããã¨ãã§ãã¾ãã
Â
GitHubã¦ã¼ã¶ã¼åãå ¥åâé£æº
Â
è²¼ãä»ãããGistãã¯ãªãã¯
Â
Â
表示ããããã¨ãã§ãã¾ããï¼
Â
ã¯ã³ã¿ããã§å¤§å¤ä¾¿å©ãªã®ã§ã¯ããã®ãã¡ã¯ä½¿ã£ã¦ããã®ã§ãããããçç±ã§ä½¿ãã®ãè¾ãã¾ããã»ã»ã»ãã®çç±ã¯
Â
Gistã®ã³ã¼ãã¯Googleã®æ¤ç´¢å¯¾è±¡ã«ãªããªã
Â
Gistãããã°ã«è²¼ãä»ãã¦ãããã°ã®å¤ã®ã³ã¼ããå¼ã³åºãã¦è¡¨ç¤ºãã¦ããã ããªã®ã§ãGoogleã®æ¤ç´¢ã¯ã¼ãã®å¯¾è±¡å¤ã«ãªã£ã¦ãã¾ãã¾ãã
Â
大å¤ä¾¿å©ã ã£ãã®ã§ãããæ³£ãæ³£ã使ãã®ãè¾ãã¾ããã
Â
â¡SyntaxHighlighter
ï¼ã¤ç®ã¯SyntaxHighlighterã§ãã
Â
ãã¡ããµã¤ããåèã«é²ãã¦ãã£ãããã¾ããã£ãã®ã§ãããUnityã®C#ã表示ããã¨è²ã ã¨ä¸å ·åãèµ·ãã£ããã使ãã®ãè¾ãã¾ããã
å ·ä½çã«ã¯ãGetComponentã§ã<GameObject>ãçã¨è¨è¿°ããæã«ãã½ã¼ã¹ã®ä¸çªå¾ãã«åãè¨è¿°ã表示ããã¦ãã¾ãã¾ããã
Â
â¢ã¯ã¦ãªè¨æ³
æå¾ã«è¾¿ãçããã®ãã¯ã¦ãªè¨æ³ã§ããã
Â
ã¯ã¦ãªããã°ã«ã¯ãããã°ã®ç·¨éæ¹æ³ã¨ãã¦è¦ãã¾ã¾ç·¨éã»ã¯ã¦ãªè¨æ³ã»MarkDownã¨ï¼ã¤ã®ç¨®é¡ãããã®ã§ãããã¯ã¦ãªè¨æ³ã使ãã¨SyntaxHighlighterã®ããã«è¨è¿°ãããã¨ãã§ãã¾ãã
Â
>|cs|
C#ããã°ã©ãã³ã°é¨å
||<
Â
ã¨è¨è¿°ããã ãã§ç¶ºéºã«è¡¨ç¤ºãããã®ã§ã大å¤ãªã¹ã¹ã¡ã§ãã
Â
ããã°åæã®é ã«ä½æããè¨äºã¯è¦ãã¾ã¾ç·¨é+Gistã§æ¸ãã¦ããã®ã§ãç·¨éæ¹æ³ãã¯ã¦ãªè¨æ³ã«æ»ãã¦Gistãç¡ãããã¨æã£ãã®ã§ãããç·¨éæ¹æ³ã¯å¾ããã¯å¤æ´ã§ããªãããã§ããã»ã»ã»
Â
çãããããã½ã¼ã¹ã³ã¼ããGoogleæ¤ç´¢ã®å¯¾è±¡ã«ãããå ´åã¯ããã²ã¯ã¦ãªè¨æ³ã使ã£ã¦ã¿ã¦ä¸ããã
Â