{"id":1528,"date":"2020-03-30T11:29:46","date_gmt":"2020-03-30T03:29:46","guid":{"rendered":"http:\/\/blog.coolcoding.cn\/?p=1528"},"modified":"2020-09-27T17:04:47","modified_gmt":"2020-09-27T09:04:47","slug":"unity%e7%9b%b4%e6%8e%a5%e5%bc%95%e7%94%a8gameobject-asset%e8%b5%84%e6%ba%90%e5%af%bc%e8%87%b4%e6%80%a7%e8%83%bd%e4%b8%8b%e9%99%8d","status":"publish","type":"post","link":"https:\/\/blog.coolcoding.cn\/?p=1528","title":{"rendered":"[Unity]\u76f4\u63a5\u5f15\u7528GameObject Asset\u8d44\u6e90\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>class Build : MonoBehaviour\n{\n  publuc GameObject buildObj;\n  public GameObject buildAnimation;\n  public GameObject buildUpgrade;\n  public GameObject buildUpEnd;\n  \n  public void foo()\n  {\n    var obj = GameObject.Instantiate(buildObj);\n    ...\n  }\n}\n\n\u4fee\u6539\u4e3a\n\nclass Build : MonoBehaviour\n{\n  publuc string buildObj;\n  public string buildAnimation;\n  public string buildUpgrade;\n  public string buildUpEnd;\n  \n  public void foo()\n  {\n    var obj = LoadPrefabByPath(buildObj);\n    ...\n  }\n}\n\n\u53ef\u5927\u5927\u63d0\u9ad8\u52a0\u8f7d\u901f\u5ea6\n1\u3001\u964d\u4f4e\u5185\u5b58\u4f7f\u7528\n2\u3001\u964d\u4f4e\u52a0\u8f7d\u65f6\u95f4<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[18],"_links":{"self":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1528"}],"collection":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1528"}],"version-history":[{"count":2,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1528\/revisions"}],"predecessor-version":[{"id":1530,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=\/wp\/v2\/posts\/1528\/revisions\/1530"}],"wp:attachment":[{"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1528"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1528"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.coolcoding.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1528"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}