{"id":241,"date":"2014-10-09T16:51:15","date_gmt":"2014-10-09T07:51:15","guid":{"rendered":"http:\/\/nantoka.filmm.info\/blog\/?p=241"},"modified":"2014-10-13T17:17:14","modified_gmt":"2014-10-13T08:17:14","slug":"unity-%e4%bb%96%e3%81%ae%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e3%81%b8%e3%83%a1%e3%83%83%e3%82%bb%e3%83%bc%e3%82%b8%e9%80%81%e4%bf%a1","status":"publish","type":"post","link":"https:\/\/nantoka.filmm.info\/blog\/?p=241","title":{"rendered":"Unity-\u4ed6\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3078\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1"},"content":{"rendered":"<p>C#\u306a\u3093\u3066\u308f\u3057\u3083\u3084\u3089\u3093\u3088\uff0c\uff0c\u3051\u3069\u3061\u3073\u3063\u3068\u304b\u3044\u3066\u307f\u308b\uff0c\uff0c<\/p>\n<p>Unity\u3067\u306e\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308b\u65b9\u6cd5\u3067\u3059<\/p>\n<p>SendMessage\u3068\u3044\u3046\u3082\u306e\u3092\u3064\u304b\u3044\u307e\u3059\uff0e<\/p>\n<p>\u540c\u3058\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5185\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3042\u308c\u3070\uff0c\u3053\u3093\u306a\u3053\u3068\u3057\u306a\u304f\u3066\u3082\uff0c\u95a2\u6570\u540d\u3060\u3051\u3067\u52d5\u304d\u307e\u3059\u3088\u301c<\/p>\n<p>\u307e\u305f\u3053\u306e\u307b\u304b\u306bfind\u3067\u63a2\u3055\u305b\u308b\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\uff0e\u3053\u306e\u5834\u5408\u306f<strong>\u30bf\u30b0<\/strong>\u3092\u3064\u3051\u3066\u3042\u3052\u308b\u306e\u3082\u3044\u3044\u3067\u3057\u3087\u3046\uff0e\u307e\u305f\uff0cBroadcastMessage\u3068\u3044\u3046\u306e\u3082\u3042\u308a\u307e\u3059\uff0e<\/p>\n<p>\u305f\u3076\u3093\u305d\u306e\u9762\u30af\u30ea\u30a2\uff01\u306a\u3093\u3066\u3044\u3046\u3068\u304d\u306b\uff0c\u300c\u6575\u3068\u3044\u3046<strong>\u30bf\u30b0<\/strong>\u300d\u306e\u3064\u3044\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5168\u90e8\u306b\u4e00\u6589\u306b\u81ea\u7206\u6307\u4ee4\u3092<strong>\u653e\u9001<\/strong>\u3057\u3066\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308b\u3068\u304b\u306b\u4f7f\u3046\u306e\u304b\u306a\uff1f<\/p>\n<hr \/>\n<p>\u672c\u984c\u3067\u3059\uff0e<\/p>\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u306f\uff12\u3064\u304b\u3089\u306a\u308a\u307e\u3059<\/p>\n<h2>\uff08\uff11\uff09\u53d7\u4fe1\u5074\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3000test1.cs<\/h2>\n<p>16\u884c\u76ee\u306b<strong><em>public<\/em><\/strong>\u304c\u3064\u3044\u3066\u3044\u307e\u3059\uff0e\u3053\u308c\u304c\u5fc5\u8981\u306a\u3088\u3046\u3067\u3059\uff0e<\/p>\n<pre class=\"wrap:true lang:c# decode:true \" title=\"SendMessage\u306e\u30b5\u30f3\u30d7\u30eb\">using UnityEngine;\r\nusing System.Collections;\r\n\r\npublic class test1 : MonoBehaviour {\r\n\r\n\t\/\/ Use this for initialization\r\n\tvoid Start () {\r\n\r\n\t}\r\n\r\n\t\/\/ Update is called once per frame\r\n\tvoid Update () {\r\n\r\n\t}\r\n\r\n\tpublic void neko(bool mybool){\/\/public\u3067\u4ed6\u304b\u3089send\u3067\u304d\u307e\u3059\uff0e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u3053\u3053\u3067\u53d7\u4fe1\u3057\u307e\u3059\uff0e\u5f15\u6570\u306f\u30d6\u30fc\u30ea\u30a2\u30f3\u3067mybool\u306b\u683c\u7d0d\u3057\u307e\u3059\r\n\t\tDebug.Log(mybool);\/\/mybool\u306b\u683c\u7d0d\u3055\u308c\u305f\u30d6\u30fc\u30ea\u30a2\u30f3\u3092\u51fa\u529b\u3057\u307e\u3059\r\n\t}\r\n}<\/pre>\n<h2>\u00a0\uff08\uff12\uff09\u9001\u4fe1\u5074\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u00a0 testzero.cs<\/h2>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u753b\u9762\u306b\u30dc\u30bf\u30f3\u304c\u8868\u793a\u3055\u308c\u307e\u3059\uff0e<\/p>\n<pre class=\"wrap:true lang:default decode:true \" title=\"\u53d7\u4fe1\u5074\">using UnityEngine;\r\nusing System.Collections;\r\n\r\npublic class testzero : MonoBehaviour {\r\n\tpublic GameObject player;\/\/player\u3068\u3044\u3046\u540d\u306e\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6307\u5b9a\u3057\u307e\u3059\r\n\/\/Unity\u306eGUI\u5074\u306b\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u9078\u629e\u3067\u304d\u308bGUI\u304c\u3067\u304d\u307e\u3059\u306e\u3067\uff0c\u305d\u3053\u306b\u53d7\u4fe1\u5074\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30a2\u30b5\u30a4\u30f3\u3057\u3066\u304f\u3060\u3055\u3044\uff0e\u4f8b\u3048\u3070Create Empty\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3060\u3051\u3042\u3066\u305f\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3082OK\u3067\u3059\r\n\r\n\t\/\/ Use this for initialization\r\n\tvoid Start () {\r\n\r\n\t}\r\n\tvoid OnGUI() {\r\n\r\n\t\tif (GUI.Button(new Rect(10, 70, 50, 30), \"Click\"))\/\/GUI\u30dc\u30bf\u30f3\u8868\u793a\r\n\t\tplayer.SendMessage(\"neko\", true);\/\/player\u306b\u30a2\u30b5\u30a4\u30f3\u3055\u308c\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u3046\u3061 neko\u3000\u3068\u3044\u3046\u30af\u30e9\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3057 true\u3092\u5f15\u6570\u3067\u6e21\u3057\u307e\u3059\r\n\t}\r\n\t\/\/ Update is called once per frame\r\n\tvoid Update () {\r\n\r\n\t}\r\n}<\/pre>\n<p>\u305d\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30b3\u30f3\u30bd\u30fc\u30eb\u306b<strong><em>true<\/em><\/strong>\u3068\u8868\u793a\u3055\u308c\u307e\u3059\uff0e<\/p>\n<p>\u3053\u308c\uff0cJavascript\u3067\u306f<\/p>\n<pre class=\"wrap:true lang:js decode:true \" title=\"JavaScript\u306e\u5834\u5408\uff08\u3053\u308c\u306f\u52d5\u4f5c\u3057\u307e\u305b\u3093\uff09\">function neko(mybool:bool){\/\/\u5f15\u6570\u306e\u578b\u306e\u5b9a\u7fa9\u306f\u4e0d\u8981\u3060\u3063\u305f\u304b\u306a\uff1f\r\n\/\/\u51e6\u7406\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3067\u306f\u52d5\u4f5c\u3057\u307e\u305b\u3093<\/p>\n<pre class=\"wrap:true lang:js decode:true\" title=\"SendMessage\u306e\u30b5\u30f3\u30d7\u30eb\">static function neko(mybool:bool){\r\n\/\/\u51e6\u7406\r\n}<\/pre>\n<p>\u3068<strong><em>static<\/em><\/strong>\u3092\u3064\u3051\u308b\u3068\u52d5\u304d\u307e\u3059\uff0e<\/p>\n<p>\u3069\u3053\u304b\u306b\u66f8\u3044\u3066\u307e\u3057\u305f\u304c\u3000static\u3000\u306f<strong>\u300c\u795e\u306e\u9818\u57df\u300d<\/strong>\u3089\u3057\u3044\u3067\u3059\uff0e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C#\u306a\u3093\u3066\u308f\u3057\u3083\u3084\u3089\u3093\u3088\uff0c\uff0c\u3051\u3069\u3061\u3073\u3063\u3068\u304b\u3044\u3066\u307f\u308b\uff0c\uff0c Unity\u3067\u306e\u4ed6\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3078\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308b\u65b9\u6cd5\u3067\u3059 SendMessage\u3068\u3044\u3046\u3082\u306e\u3092\u3064\u304b\u3044\u307e\u3059\uff0e \u540c\u3058\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u5185\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3042\u308c\u3070\uff0c\u3053\u3093\u306a\u3053\u3068\u3057 &hellip; <a href=\"https:\/\/nantoka.filmm.info\/blog\/?p=241\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">Unity-\u4ed6\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3078\u30e1\u30c3\u30bb\u30fc\u30b8\u9001\u4fe1<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,11,2],"tags":[],"class_list":["post-241","post","type-post","status-publish","format-standard","hentry","category-c","category-javascript","category-unity"],"_links":{"self":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=241"}],"version-history":[{"count":12,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/241\/revisions"}],"predecessor-version":[{"id":280,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=\/wp\/v2\/posts\/241\/revisions\/280"}],"wp:attachment":[{"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nantoka.filmm.info\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}