{"id":3847,"date":"2018-06-02T20:12:15","date_gmt":"2018-06-02T11:12:15","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=3847"},"modified":"2023-05-19T22:41:19","modified_gmt":"2023-05-19T13:41:19","slug":"%e3%80%90unity%e3%80%91c-%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e3%82%92%e3%83%87%e3%83%90%e3%83%83%e3%82%b0%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=3847","title":{"rendered":"\u3010Unity\u3011\u300cMonoBehaviour(\u30e2\u30ce\u30d3\u30d8\u30a4\u30d3\u30a2)\u300d\u3068\u306f\u4f55\u304b\uff1f"},"content":{"rendered":"<p>Unity\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u751f\u6210\u3057\u305f\u969b\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">using System.Collections;\r\nusing System.Collections.Generic;\r\nusing UnityEngine;\r\n\r\npublic class Test : MonoBehaviour {\r\n\r\n\tvoid Start() {\r\n\t}\r\n\r\n\tvoid Update() {\r\n\t}\r\n}<\/pre>\n<p><span style=\"color: #ff0000;\"><strong>\u300cMonoBehaviour(\u30e2\u30ce\u30d3\u30d8\u30a4\u30d3\u30a2)\u300d<\/strong><\/span>\u3068\u3044\u3046\u30af\u30e9\u30b9\u304c\u7d99\u627f\u3055\u308c\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u4e00\u4f53\u4f55\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<h2><strong>MonoBehaviour(\u30e2\u30ce\u30d3\u30d8\u30a4\u30d3\u30a2)\u3068\u306f\uff1f<\/strong><\/h2>\n<p>\u5168\u3066\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306e<span style=\"color: #ff0000;\"><strong>\u300c\u30d9\u30fc\u30b9\u30af\u30e9\u30b9\u300d<\/strong><strong>\u3067\u3001\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u5236\u5fa1\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u6a5f\u80fd\u3092\u63d0\u4f9b<\/strong><\/span>\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Unity\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u3001\u300cMonoBehaviour\u300d\u3068\u3044\u3046\u30af\u30e9\u30b9\u306e\u5b50\u30af\u30e9\u30b9\u3067\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3068\u3044\u3046\u30eb\u30fc\u30eb\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>\u305f\u3060\u3057\u4e00\u90e8\u4f8b\u5916\u306f\u3042\u308a\u3002<\/h3>\n<p>Unity\u4e0a\u306b\u5b9f\u4f53\u304c\u3042\u308b\u30af\u30e9\u30b9\u306f\u3001\u3082\u3061\u308d\u3093\u300cMonoBehaviour\u300d\u3092\u7d99\u627f\u3055\u305b\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u305f\u3060\u306e\u30ed\u30b8\u30c3\u30af\u3092\u8a18\u8f09\u3059\u308b\u3060\u3051\u306e\u30af\u30e9\u30b9\u7b49\u306eUnity\u4e0a\u306b\u5b9f\u4f53\u306e\u306a\u3044\u30af\u30e9\u30b9\u7b49\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u7d99\u627f\u3055\u305b\u308b\u5fc5\u8981\u306f\u306a\u3044<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h2><strong>MonoBehaviour\u306e<\/strong>\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9<\/h2>\n<h3>GameObject\u306b\u30b2\u30fc\u30e0\u306e\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/h3>\n<p>\u30b2\u30fc\u30e0\u306e\u30ad\u30e3\u30e9\u30af\u30bf\u30fc\u3084\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306a\u3069\u3082MonoBehaviour\u3092\u7d99\u627f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u958b\u59cb\u3001\u7d42\u4e86\u30dd\u30a4\u30f3\u30c8<\/h3>\n<p>\u5f8c\u8ff0\u3059\u308bStart\u3001Update\u30e1\u30bd\u30c3\u30c9\u306a\u3069\u3067\u3059\u3002(\u4ed6\u306b\u3082\u3001Awake\u3001OnEnable\u3001OnDisable\u3001OnDestroy\u306a\u3069\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u3059\u3002\uff09<\/p>\n<h2>Start\u30e1\u30bd\u30c3\u30c9\u3001Update\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066<\/h2>\n<p>\u3053\u308c\u3082\u3001Monobehaviour\u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u4e00\u3064\u3067\u3001<span style=\"color: #ff0000;\"><strong>Unity\u306e\u30b7\u30b9\u30c6\u30e0\u304b\u3089\u547c\u3073\u51fa\u3055\u308c\u308b\u30a4\u30d9\u30f3\u30c8\u95a2\u6570\u3068\u547c\u3070\u308c\u308b\u3082\u306e<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<h3>Start\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u521d\u671f\u5316\u30a4\u30d9\u30f3\u30c8<\/strong><\/span>\u3067\u3059\u3002\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u767b\u5834\u3057\u305f\u969b\u306b\u4f55\u304b\u3055\u305b\u305f\u3044\u5834\u5408\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<h3>Update\u30e1\u30bd\u30c3\u30c9<\/h3>\n<p><span style=\"color: #ff0000;\"><strong>\u5b9a\u671f\u30a4\u30d9\u30f3\u30c8<\/strong><\/span>\u3067\u3059\u3002\u30b2\u30fc\u30e0\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u51fa\u73fe\u5f8c\u306b\u5b9a\u671f\u7684\u306b\u4f55\u304b\u3092\u3055\u305b\u305f\u3044\u5834\u5408\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><span style=\"color: #000000;\">\u5b9a\u671f\u30a4\u30d9\u30f3\u30c8\u306f\u3001<\/span><strong>\u30d5\u30ec\u30fc\u30e0<\/strong><\/span>\u3054\u3068\u306b\u547c\u3073\u51fa\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u300c\u30d5\u30ec\u30fc\u30e0\u300d\u3068\u306f\uff1f<\/h2>\n<p>\u30b2\u30fc\u30e0\u304c\u753b\u9762\u3092\u66f8\u304d\u63db\u3048\u308b1\u30b3\u30de\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u30d5\u30ec\u30fc\u30e0\u30921\u79d2\u9593\u306b\u66f8\u304d\u63db\u3048\u308b\u56de\u6570\u306e\u3053\u3068\u3092<span style=\"color: #ff0000;\"><strong>fps(frame per second)<\/strong><\/span>\u3068\u547c\u3073\u307e\u3059\u3002<\/p>\n<h3>fps\u306e\u5e73\u5747\u56de\u6570\u306f\uff1f<\/h3>\n<p>fps\u306e\u5e73\u5747\u56de\u6570\u306f\u6027\u80fd\u3082\u3088\u308a\u307e\u3059\u304c\u3001\u7aef\u672b\u306b\u3088\u3063\u3066\u304b\u306a\u308a\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u7aef\u672b<\/th>\n<th>fps<\/th>\n<\/tr>\n<tr>\n<td>\u30d1\u30bd\u30b3\u30f3<\/td>\n<td>50\uff5e60<\/td>\n<\/tr>\n<tr>\n<td>\u30b9\u30de\u30db<\/td>\n<td>20<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"Unity\u3067\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u751f\u6210\u3057\u305f\u969b\u306f\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u5185\u5bb9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002 using System.Collections; using System.Collections.Generic; usi [&hellip;]","protected":false},"author":1,"featured_media":3779,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[42],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/3847"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3847"}],"version-history":[{"count":10,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/3847\/revisions"}],"predecessor-version":[{"id":19705,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/3847\/revisions\/19705"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/3779"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3847"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}