{"id":620,"date":"2016-10-29T16:01:20","date_gmt":"2016-10-29T07:01:20","guid":{"rendered":"http:\/\/naochang.me\/?p=620"},"modified":"2016-10-29T16:01:20","modified_gmt":"2016-10-29T07:01:20","slug":"%e6%96%87%e5%ad%97%e5%88%97%e3%81%8b%e3%82%89staticclass%e3%83%97%e3%83%ad%e3%83%91%e3%83%86%e3%82%a3%e3%81%ae%e5%8f%96%e5%be%97","status":"publish","type":"post","link":"https:\/\/stacstar.jp\/blog\/?p=620","title":{"rendered":"\u6587\u5b57\u5217\u304b\u3089static\/class\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u53d6\u5f97"},"content":{"rendered":"<p>static\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6587\u5b57\u5217\u304b\u3089\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u304c\u308f\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u8abf\u3079\u3066\u307f\u305f\u3002<br \/>\n\u3064\u3044\u3067\u306b\u3001\u6587\u5b57\u5217\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u53d6\u308a\u51fa\u3057\u3068\u30e1\u30bd\u30c3\u30c9\u306e\u5b9f\u884c\u3082\u3002<\/p>\n<pre class=\"brush: unitycsharp; title: ; notranslate\" title=\"\">\r\nclass TestClass {\r\n\tpublic static string StaticPropName = &quot;StaticValue&quot;;\r\n\tpublic int propName = 100;\r\n\tpublic string TestFunc(int num) {\r\n\t\treturn &quot;TestFuncValue : &quot; + num;\r\n\t}\r\n}\r\n\r\nTestClass test = new TestClass();\r\nType testType = test.GetType();\r\nprint(testType.GetField(&quot;propName&quot;).GetValue(test));\r\n\/\/ \u51fa\u529b : 100\r\n\r\nprint(testType.GetMethod(&quot;TestFunc&quot;).Invoke(test, new object&#x5B;]{ 777 }));\r\n\/\/ \u51fa\u529b : TestFuncValue : 777\r\n\r\nType typeOfTestClass = typeof(TestClass);\r\nprint(typeOfTestClass.GetField(&quot;StaticPropName&quot;).GetValue(typeOfTestClass));\r\n\/\/ \u51fa\u529b : StaticValue\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>static\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6587\u5b57\u5217\u304b\u3089\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u304c\u308f\u304b\u3089\u306a\u304b\u3063\u305f\u306e\u3067\u8abf\u3079\u3066\u307f\u305f\u3002 \u3064\u3044\u3067\u306b\u3001\u6587\u5b57\u5217\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u53d6\u308a\u51fa\u3057\u3068\u30e1\u30bd\u30c3\u30c9\u306e\u5b9f\u884c\u3082\u3002 class TestClass { public static s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,2],"tags":[],"class_list":["post-620","post","type-post","status-publish","format-standard","hentry","category-c","category-unity"],"_links":{"self":[{"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/620","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=620"}],"version-history":[{"count":3,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/620\/revisions"}],"predecessor-version":[{"id":623,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/620\/revisions\/623"}],"wp:attachment":[{"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=620"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=620"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stacstar.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=620"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}