{"id":11109,"date":"2020-06-22T11:02:18","date_gmt":"2020-06-22T02:02:18","guid":{"rendered":"https:\/\/madnesslabo.net\/utage?page_id=11109"},"modified":"2024-07-23T08:14:18","modified_gmt":"2024-07-22T23:14:18","slug":"unity%e3%81%ae%e3%83%97%e3%83%ad%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%81%af%e3%81%aa%e3%81%9c%e5%a3%8a%e3%82%8c%e3%82%8b%e3%81%ae%e3%81%8b%e3%80%82%e5%8e%9f%e5%9b%a0%e3%81%a8%e5%af%be%e7%ad%96-2-2","status":"publish","type":"page","link":"https:\/\/madnesslabo.net\/utage\/?page_id=11109","title":{"rendered":"Unity\u3067\u306e\u8907\u6570\u30b7\u30fc\u30f3\u3092\u4f7f\u3063\u305f\u30b2\u30fc\u30e0\u306e\u5b9f\u88c5\u65b9\u6cd5\u3068\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<h2>\u8907\u6570\u30b7\u30fc\u30f3\u5b9f\u88c5\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u305f\u80cc\u666f<\/h2>\n<h3>\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u306a\u3044<\/h3>\n<p>Unity\u3067\u306f\u3001\u30b7\u30fc\u30f3\u3092\u7de8\u96c6\u3057\u3066\u30b2\u30fc\u30e0\u3092\u4f5c\u3063\u3066\u3044\u304f\u306e\u304c\u57fa\u672c\u3067\u3059\u3002<br \/>\n\u30b7\u30fc\u30f3\u306f\u4e00\u3064\u3067\u306f\u306a\u304f\u8907\u6570\u4f7f\u3063\u3066\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u8a73\u3057\u3044\u3084\u308a\u65b9\u306b\u95a2\u3057\u3066\u306fUnity\u306e\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u306f\u3069\u3053\u306b\u3082\u8f09\u3063\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n<a href=\"https:\/\/docs.unity3d.com\/jp\/current\/Manual\/CreatingScenes.html\">Unity\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u300c\u30b7\u30fc\u30f3\u300d<\/a>\u306b\u306f\u3001\u5358\u4e00\u30b7\u30fc\u30f3\u306e\u7c21\u5358\u306a\u89e3\u8aac\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n<a href=\"https:\/\/docs.unity3d.com\/jp\/current\/Manual\/MultiSceneEditing.html\">\u8907\u6570\u30b7\u30fc\u30f3\u306e\u7de8\u96c6<\/a>\u3068\u3044\u3046\u30da\u30fc\u30b8\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u57fa\u672c\u7684\u306b\u306fUnity\u30a8\u30c7\u30a3\u30bf\u4e0a\u3067\u8907\u6570\u306e\u30b7\u30fc\u30f3\u3092\u540c\u6642\u306b\u7de8\u96c6\u3059\u308b\u969b\u306e\u3084\u308a\u65b9\u3067\u3042\u3063\u3066\u3001\u809d\u5fc3\u306e\u300c\u5b9f\u88c5\u65b9\u6cd5\u300d\u306b\u95a2\u3057\u3066\u306fTIPS\u7a0b\u5ea6\u3057\u304b\u306a\u3044\u3088\u3046\u3067\u3059\u3002<br \/>\n\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3067\u306f\u306a\u304f<a href=\"https:\/\/docs.unity3d.com\/jp\/current\/ScriptReference\/SceneManagement.SceneManager.html\">\u30b9\u30af\u30ea\u30d7\u30c8\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/a>\u306e\u307b\u3046\u306b\u306f\u500b\u5225\u306e\u6a5f\u80fd\u306e\u8aac\u660e\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u65e5\u672c\u8a9e\u8a33\u304c\u307b\u307c\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<h3>\u4eba\u306b\u3088\u3063\u3066\u3084\u308a\u65b9\u304c\u9055\u3046<\/h3>\n<p>Unity\u306e\u8907\u6570\u30b7\u30fc\u30f3\u3092\u4f7f\u3063\u305f\u5b9f\u88c5\u65b9\u6cd5\u81ea\u4f53\u306f\u53e4\u304f\u304b\u3089\u8b70\u8ad6\u3055\u308c\u3066\u3044\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u4e0a\u306b\u3082\u3044\u304f\u3064\u304b\u60c5\u5831\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u66f8\u7c4d\u306a\u3069\u306e\u307e\u3068\u307e\u3063\u305f\u60c5\u5831\u306f\u975e\u5e38\u306b\u5c11\u306a\u3044\u3088\u3046\u3067\u3059\u3002<br \/>\n\u300c\u3053\u308c\u304c\u6b63\u89e3\u300d\u3068\u3044\u3046\u3082\u306e\u306a\u304f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u6027\u8cea\u3084\u5b9f\u88c5\u8005\u304c\u4f55\u3092\u91cd\u8996\u3059\u308b\u304b\u3067\u3084\u308a\u65b9\u3082\u9055\u3046\u3001\u3044\u3046\u306a\u308c\u3070\u300cUnity\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8a2d\u8a08\u300d\u305d\u306e\u3082\u306e\u3067\u3082\u3042\u308b\u305f\u3081\u3001\u306a\u304b\u306a\u304b\u306b\u6271\u3046\u306e\u304c\u96e3\u3057\u3044\u306e\u3060\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u304b\u304f\u3044\u3046\u79c1\u3082\u3001\u305a\u3044\u3076\u3093\u6614\u306b\u8907\u6570\u30b7\u30fc\u30f3\u306e\u5b9f\u88c5\u306b\u95a2\u3057\u3066\u307e\u3068\u3081\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3060\u3044\u3076\u504f\u3063\u305f\u3084\u308a\u65b9\u3060\u3063\u305f\u305f\u3081\u300c\u53c2\u8003\u306b\u3057\u305f\u3082\u306e\u306e\u30d0\u30b0\u306e\u6e29\u5e8a\u306b\u306a\u3063\u305f\u300d\u300c\u30d0\u30c3\u30c9\u30ce\u30a6\u30cf\u30a6\u300d\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u53d7\u3051\u3066\u3044\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u3001\u500b\u4eba\u500b\u4eba\u3084\u308a\u65b9\u304c\u9055\u3063\u3066\u5f53\u7136\u306a\u306e\u3067\u3001\u305d\u308c\u305e\u308c\u306b\u6700\u9069\u306a\u3084\u308a\u65b9\u3092\u898b\u3064\u3051\u3066\u3044\u3051\u3070\u3088\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u3060\u3093\u3060\u3093\u60c5\u5831\u304c\u65ad\u7d76\u3057\u3066\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u305f\u3081\u3001\u521d\u5fc3\u8005\u306e\u4eba\u306b\u3068\u3063\u3066\u306f\u3069\u3093\u3069\u3093\u5b66\u7fd2\u30cf\u30fc\u30c9\u30eb\u304c\u9ad8\u304f\u306a\u3063\u3066\u3044\u308b\u3088\u3046\u306b\u611f\u3058\u3066\u3044\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u3001\u30ce\u30d9\u30eb\u30b2\u30fc\u30e0\u30c4\u30fc\u30eb\u300c\u5bb4\u300d\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u3057\u3066\u3044\u308b\u3068\u3001\u3053\u306e\u70b9\u3067\u8e93\u304f\u4eba\u304c\u591a\u304f\u3044\u307e\u3057\u305f\u3002<br \/>\n\u306a\u306e\u3067\u3001\u3053\u306e\u6a5f\u4f1a\u306b\u3082\u3046\u4e00\u5ea6\u307e\u3068\u3081\u3066\u307f\u3088\u3046\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u521d\u5fc3\u8005\u306e\u4eba\u306b\u3082\u308f\u304b\u308a\u3084\u3059\u304f\u306f\u3057\u305f\u3044\u306e\u3067\u3059\u304c\u3001\u3042\u307e\u308a\u7701\u7565\u3059\u308b\u3068\u307e\u305f\u30d0\u30c3\u30c9\u30ce\u30a6\u30cf\u30a6\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u5c02\u9580\u7684\u306a\u8a71\u3082\u6df7\u3056\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u308f\u304b\u3089\u306a\u3044\u3068\u3053\u308d\u306f\u8aad\u307f\u98db\u3070\u3057\u3066\u8e93\u3044\u305f\u3089\u8aad\u307f\u76f4\u3059\u7a0b\u5ea6\u3067\u5168\u4f53\u50cf\u3092\u3064\u304b\u3093\u3067\u3044\u305f\u3060\u3051\u308c\u3070\u3068\u3002<\/p>\n<h2>\u8907\u6570\u30b7\u30fc\u30f3\u5b9f\u88c5\u306e\u30e1\u30ea\u30c3\u30c8\u3068\u30c7\u30e1\u30ea\u30c3\u30c8<\/h2>\n<p>\u8907\u6570\u30b7\u30fc\u30f3\u3067\u5b9f\u88c5\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u306e\u4e00\u756a\u306f\u300c\u7de8\u96c6\u30b7\u30fc\u30f3\u3092\u8907\u6570\u306b\u5206\u3051\u3089\u308c\u308b\u306e\u3067\u3001\u5206\u62c5\u4f5c\u696d\u3092\u3057\u3084\u3059\u3044\u300d\u3068\u3044\u3046\u70b9\u3067\u3059\u3002<br \/>\n\u30c1\u30fc\u30e0\u958b\u767a\u3067\u306f\u3001\u30b7\u30fc\u30f3\u3092\u540c\u6642\u306b\u7de8\u96c6\u3057\u3066\u3057\u307e\u3046\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u304c\u885d\u7a81\u3057\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u3053\u308c\u3092\u907f\u3051\u308b\u3068\u3044\u3046\u76ee\u7684\u304c\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u6163\u308c\u3066\u304f\u308b\u3068\u300cUI\u30b7\u30fc\u30f3\u300d\u300c\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u300d\u300c\u30d0\u30c8\u30eb\u306e\u30b7\u30fc\u30f3\u300d\u306a\u3069\u306e\u3088\u3046\u306b\u6a5f\u80fd\u5225\u306b\u5206\u3051\u3089\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3001\u958b\u767a\u304c\u30b9\u30e0\u30fc\u30ba\u306b\u306a\u308b\u3068\u3044\u3046\u30e1\u30ea\u30c3\u30c8\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u9006\u306b\u30c7\u30e1\u30ea\u30c3\u30c8\u3068\u3057\u3066\u306f\u3001\u5b9f\u88c5\u306e\u30cf\u30fc\u30c9\u30eb\u3067\u3059\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u306f\u81ea\u529b\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3059\u308b\u3057\u304b\u306a\u3044\u3067\u3059\u3002<br \/>\n\u30b7\u30fc\u30f3\u3092\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3044\u3046\u57fa\u672c\u7684\u306a\u90e8\u5206\u3082\u305d\u3046\u3067\u3059\u3057\u3001Unity\u306f\u7de8\u96c6\u4e2d\u306f\u307b\u304b\u306e\u30b7\u30fc\u30f3\u3078\u306e\u53c2\u7167\u3092\u3082\u3066\u306a\u3044\u305f\u3081\u3001\u5b9f\u884c\u4e2d\u306b\u5225\u306e\u30b7\u30fc\u30f3\u540c\u58eb\u3067\u60c5\u5831\u3092\u3084\u308a\u3068\u308a\u3067\u304d\u308b\u3088\u3046\u5b9f\u88c5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u305d\u308c\u306b\u3088\u3063\u3066\u30b7\u30fc\u30f3\u5916\u306b\u53c2\u7167\u95a2\u4fc2\u304c\u5897\u3048\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u3044\u3046\u5384\u4ecb\u306a\u554f\u984c\u3092\u5f15\u304d\u8d77\u3053\u3057\u3084\u3059\u3044\u3068\u3044\u3046\u96e3\u70b9\u304c\u51fa\u3066\u304d\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306b\u95a2\u3057\u3066\u306f\u554f\u984c\u306b\u306a\u3089\u306a\u3044\u3068\u304d\u306f\u4f55\u3082\u3057\u306a\u304f\u3066\u3082\u826f\u3044\u306e\u3067\u3059\u304c\u3001\u3044\u3056\u554f\u984c\u304c\u304a\u304d\u308b\u3068\u5c02\u696d\u306e\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u3067\u3082\u982d\u3092\u60a9\u307e\u305b\u308b\u6280\u8853\u7684\u306b\u96e3\u3057\u3044\u554f\u984c\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<h3>\u305d\u3082\u305d\u3082\u5358\u4e00\u30b7\u30fc\u30f3\u3067\u5b9f\u88c5\u3059\u308c\u3070\u3044\u3044\u3067\u306e\u306f\uff1f<\/h3>\n<p>\u6b63\u76f4\u306a\u3068\u3053\u308d\u3001\u5358\u4e00\u306e\u30b7\u30fc\u30f3\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u69cb\u6210\u3067\u304d\u308b\u306a\u3089\u305d\u308c\u304c\u4e00\u756a\u697d\u306a\u306e\u3067\u3001\u305d\u308c\u3067\u826f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u3001\u5358\u4e00\u30b7\u30fc\u30f3\u3067\u5b9f\u88c5\u3057\u3066\u3044\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3082\u591a\u3044\u3068\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u5404UI\u753b\u9762\u306a\u3069\u306e\u30d7\u30ec\u30cf\u30d6\u3092\u5225\u3005\u306e\u30b7\u30fc\u30f3\u3067\u4f5c\u6210\u3057\u3001\u5b9f\u969b\u306e\u30b2\u30fc\u30e0\u3067\u306f\u305d\u306e\u30d7\u30ec\u30cf\u30d6\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u5b9f\u88c5\u3059\u308b\u3068\u3044\u3046\u3084\u308a\u65b9\u3092\u3059\u308c\u3070\u3001\u7de8\u96c6\u30b7\u30fc\u30f3\u306e\u5206\u62c5\u4f5c\u696d\u3082\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\u6614\u306f\u30b3\u30c4\u304c\u3044\u308b\u3088\u3046\u3067\u3057\u305f\u304c\u3001Unity\u306e\u30d7\u30ec\u30cf\u30d6\u306f\u5165\u308c\u5b50\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u305f\u3081\u304b\u306a\u308a\u5b9f\u88c5\u30cf\u30fc\u30c9\u30eb\u306f\u4e0b\u304c\u3063\u3066\u3044\u308b\u3068\u601d\u308f\u308c\u307e\u3059\u3002<\/p>\n<h2>\u8907\u6570\u30b7\u30fc\u30f3\u306e\u5b9f\u88c5\u306e\u57fa\u672c<\/h2>\n<p>Unity\u3067\u8907\u6570\u30b7\u30fc\u30f3\u3092\u4f7f\u3046\u306b\u306f\u307e\u305a\u3001<a href=\"https:\/\/docs.unity3d.com\/ja\/2018.4\/Manual\/BuildSettings.html\">BuildSettings<\/a>\u306b\u4f7f\u7528\u3059\u308b\u30b7\u30fc\u30f3\u3092\u3059\u3079\u3066\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3053\u308c\u3092\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u3001\u30b7\u30fc\u30f3\u306e\u30ed\u30fc\u30c9\u304c\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1065.png\" alt=\"\" \/><\/p>\n<p>\u30b2\u30fc\u30e0\u306e\u5b9f\u884c\u4e2d\u306bUnity\u3067\u5225\u306e\u30b7\u30fc\u30f3\u3092\u30ed\u30fc\u30c9\u3059\u308b\u306b\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u547c\u3073\u51fa\u3059\u3057\u304b\u306a\u304f\u3001<a href=\"https:\/\/docs.unity3d.com\/jp\/current\/ScriptReference\/SceneManagement.SceneManager.LoadScene.html\">SceneManager.LoadScene<\/a>\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n\u975e\u540c\u671f\u7248<a href=\"https:\/\/docs.unity3d.com\/ja\/2017.4\/ScriptReference\/SceneManagement.SceneManager.LoadSceneAsync.html\">SceneManager.LoadSceneAsync<\/a>\u3082\u3042\u308a\u3001\u5b9f\u969b\u306b\u306f\u3053\u3061\u3089\u3092\u4f7f\u3046\u30b1\u30fc\u30b9\u306e\u307b\u3046\u304c\u591a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\nLoadScene\u3082LoadSceneAsync\u306e\u9055\u3044\u306f\u3001\u540c\u671f\u51e6\u7406\uff08\u91cd\u3044\u30b7\u30fc\u30f3\u306e\u5834\u5408\u306f\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u308b\u307e\u3067\u30b2\u30fc\u30e0\u304c\u56fa\u307e\u308b\uff09\u304b\u3001\u975e\u540c\u671f\uff08\u30ed\u30fc\u30c9\u3057\u3066\u3044\u308b\u6700\u4e2d\u3082\u30b2\u30fc\u30e0\u3092\u6b62\u3081\u306a\u3044\u3067\u3059\u3080\uff09\u3068\u3044\u3046\u9055\u3044\u3067\u3059\u3002<br \/>\n\u7b2c\u4e8c\u5f15\u6570\u306b\u306f\u300cLoadSceneMode.Single\u300d\u3068\u300cLoadSceneMode.Addtive\u300d\u306e\u3044\u305a\u308c\u304b\u304c\u6307\u5b9a\u3067\u304d\u3001\u6307\u5b9a\u304c\u306a\u304b\u3063\u305f\u5834\u5408\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306fLoadSceneMode.Single\u3067\u3059\u3002<br \/>\n\u3053\u306e\u4e8c\u3064\u306f\u5927\u304d\u304f\u76ee\u7684\u3082\u4f7f\u3044\u65b9\u3082\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30ed\u30fc\u30c9\u3059\u308b\u30b7\u30fc\u30f3\u306f\u4e00\u5ea6\u306b\u4e00\u3064\u3060\u3051\u3000LoadSceneMode.Single<\/h2>\n<h3>\u6982\u8981<\/h3>\n<p>LoadScene\uff08\u307e\u305f\u306fLoadSceneAsync\uff09\u3067\u7b2c\u4e8c\u5f15\u6570\u3092\u6307\u5b9a\u3057\u306a\u3044\u304b\u3001\u300cLoadSceneMode.Single\u300d\u3068\u3059\u308b\u3068\u3001\u524d\u306e\u30b7\u30fc\u30f3\u3092\u3059\u3079\u3066\u524a\u9664\u3057\u3066\u6b21\u306e\u30b7\u30fc\u30f3\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<br \/>\n\u300cSingle\u300d\u306e\u540d\u306e\u901a\u308a\u3001\u4e00\u5ea6\u306b\u30ed\u30fc\u30c9\u3057\u3066\u304a\u3051\u308b\u30b7\u30fc\u30f3\u306f\u4e00\u3064\u3060\u3051\u3068\u3044\u3046\u4f7f\u3044\u65b9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre><code class=\"language-csharp\">using UnityEngine;\nusing UnityEngine.SceneManagement;\n\npublic class Sample: MonoBehaviour\n{\n    public void OnLoadSceneSingle()\n    {\n        \/\/SceneB\u3092\u30ed\u30fc\u30c9\u3002\u73fe\u5728\u306e\u30b7\u30fc\u30f3\u306f\u81ea\u52d5\u7684\u306b\u524a\u9664\u3055\u308c\u3066\u3001\u30b7\u30fc\u30f3B\u3060\u3051\u306b\u306a\u308b\n        SceneManager.LoadScene(&quot;SceneB&quot;);\n    }\n\n}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1069.png\" width=700><\/p>\n<p>\u521d\u5fc3\u8005\u306e\u4eba\u304c\u8e93\u304d\u304c\u3061\u306a\u70b9\u3067\u3059\u304c\u3001\u4e00\u5ea6\u524a\u9664\u3055\u308c\u305f\u30b7\u30fc\u30f3\u3092\u4e8c\u56de\u76ee\u4ee5\u964d\u30ed\u30fc\u30c9\u3057\u305f\u5834\u5408\u3001\u524d\u56de\u306e\u72b6\u614b\u306f\u5fa9\u5e30\u3055\u308c\u305a\u306b\u6700\u521d\u306e\u72b6\u614b\u304b\u3089\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002<br \/>\n\u30b2\u30fc\u30e0\u306eUI\u753b\u9762\u3092\u5207\u308a\u66ff\u3048\u308b\u3088\u3046\u306b\u300c\u3055\u3063\u304d\u306e\u72b6\u614b\u306b\u623b\u308b\u300d\u3068\u3044\u3046\u3064\u3082\u308a\u3067\u30b7\u30fc\u30f3\u3092\u5207\u308a\u66ff\u3048\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1070.png\" width=700><\/p>\n<h3>\u30b7\u30fc\u30f3\u3092\u307e\u305f\u3044\u3067\u6d88\u3055\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308b\u306b\u306fDontDestroyOnLoad\u3092\u4f7f\u3046<\/h3>\n<p>LoadSceneMode.Single\u3067\u30b7\u30fc\u30f3\u3092\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001\u57fa\u672c\u7684\u306b\u306f\u305d\u308c\u307e\u3067\u306e\u30b7\u30fc\u30f3\u5185\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3059\u3079\u3066\u7834\u68c4\u3055\u308c\u3066\u6d88\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u305d\u308c\u3060\u3068\u30b2\u30fc\u30e0\u306e\u30b9\u30b3\u30a2\u306a\u3069\u3068\u3044\u3063\u305f\u300c\u524d\u306e\u30b7\u30fc\u30f3\u306e\u60c5\u5831\u3092\u6b8b\u3057\u3066\u304a\u304f\u300d\u3053\u3068\u3084\u30b5\u30a6\u30f3\u30c9\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306e\u3088\u3046\u306a\u300c\u4e00\u5ea6\u30b2\u30fc\u30e0\u8d77\u52d5\u3057\u305f\u3089\u524a\u9664\u3057\u305f\u304f\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u300d\u307e\u3067\u6d88\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u305d\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u306b\u306f\u3001\u6d88\u3057\u305f\u304f\u306a\u3044\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b<a href=\"https:\/\/docs.unity3d.com\/ScriptReference\/Object.DontDestroyOnLoad.html\">DontDestroyOnLoad<\/a>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre><code class=\"language-csharp\">using UnityEngine;\n\npublic class Sample: MonoBehaviour\n{\n    void Awake()\n    {\n        DontDestroyOnLoad(this.gameObject);\n    }\n}\n<\/code><\/pre>\n<p>DontDestroyOnLoad\u3068\u3057\u305fGameObject\u306f\u3001DontDestroy\u30b7\u30fc\u30f3\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<br \/>\nDontDestroy\u30b7\u30fc\u30f3\u306b\u79fb\u3063\u305fGameObject\u306f\u3001\u30b7\u30fc\u30f3\u306e\u30b7\u30f3\u30b0\u30eb\u30ed\u30fc\u30c9\u6642\u306b\u3082\u524a\u9664\u3055\u308c\u305a\u81ea\u5206\u3067\u660e\u793a\u7684\u306b\u6d88\u3055\u306a\u3044\u9650\u308a\u306f\u30b2\u30fc\u30e0\u4e2d\u305a\u3063\u3068\u5b58\u5728\u3057\u7d9a\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1077.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1079.png\" width=700><\/p>\n<h4>\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u5185\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092DontDestroyOnLoad\u306b\u3059\u308b<\/h4>\n<p>\u7c21\u5358\u306a\u5b9f\u88c5\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001\u5e38\u306b\u30b2\u30fc\u30e0\u5168\u822c\u3092\u7ba1\u7406\u3059\u308b\u300cGameManager\u300d\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u3082\u3063\u305f\u300c\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u300d\u3092\u4f5c\u308a\u3001GameManager\u306bDontDestroyOnLoad\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u3067\u3059\u3002<br \/>\n\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u304b\u3089\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3001\u3042\u3068\u306f\u30b2\u30fc\u30e0\u306eUI\u9077\u79fb\u306a\u3069\u5fdc\u3058\u3066\u9806\u756a\u306b\u30b7\u30fc\u30f3\u3092\u5207\u308a\u66ff\u3048\u3066\u3044\u3051\u3070\u3088\u304f\u306a\u308a\u307e\u3059\u3002<br \/>\nDontDestroy\u3059\u308b\u306e\u306fGameManager\u4e00\u3064\u3068\u306f\u9650\u3089\u305a\u306b\u3001\u307b\u304b\u306b\u30b5\u30a6\u30f3\u30c9\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306a\u3069\u8907\u6570\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u540c\u3058\u3088\u3046\u306b\u6271\u3063\u3066\u3082\u3088\u3044\u3067\u3059\u3057\u3001GameManager\u306e\u5b50\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3057\u3066\u30b5\u30a6\u30f3\u30c9\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306a\u3069\u3092\u914d\u7f6e\u3057\u3066\u3082\u826f\u3044\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1081.png\" width=700><\/p>\n<h4>\u30d7\u30ec\u30cf\u30d6\u5316\u3057\u305f\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092DontDestroyOnLoad\u306b\u3059\u308b<\/h4>\n<p>\u300c\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u304b\u3089\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u300d\u3068\u3044\u3046\u306e\u306f\u3001\u7de8\u96c6\u4e2d\u306e\u30b7\u30fc\u30f3\u3092\u3044\u3063\u305f\u3093\u9589\u3058\u3066\u304b\u3089\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u3092\u3044\u3061\u3044\u3061\u958b\u304b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u306e\u3067\u3001\u958b\u767a\u306e\u969c\u5bb3\u306b\u306a\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3053\u3067\u3001GameManager\u3092\u30d7\u30ec\u30cf\u30d6\u5316\u3057<br \/>\n\u5404\u30b7\u30fc\u30f3\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306a\u300c\u30d7\u30ec\u30cf\u30d6\u304b\u3089GameManager\u30921\u5ea6\u3060\u3051\u81ea\u52d5\u7684\u306b\u4f5c\u6210\u3057DontDestroyOnLoad\u3059\u308b\u300d\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3001<br \/>\n\u305d\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5404\u30b7\u30fc\u30f3\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre><code class=\"language-csharp\">using UnityEngine;\n\npublic class GameManagerCreator : MonoBehaviour\n{\n    private static bool Loaded { get; set; }\n\n    [SerializeField] \n    GameObject[] gameManagerPrefabs = null;\n\n    void Awake()\n    {\n        \/\/\u3059\u3067\u306b\u30ed\u30fc\u30c9\u6e08\u307f\u306a\u3089\u3001\u4e8c\u91cd\u306b\u4f5c\u6210\u3057\u306a\u3044\n        if(Loaded) return;\n\n        Loaded = true;\n\n        \/\/\u30d7\u30ec\u30cf\u30d6\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3057\u3066\u3001DontDestroyOnLoad\n        foreach (var prefab in gameManagerPrefabs)\n        {\n            GameObject go = Instantiate(prefab);\n            DontDestroyOnLoad(go);\n        }\n    }\n}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1082.png\" width=800><\/p>\n<p>\u5b9f\u969b\u306e\u3068\u3053\u308d\u306f\u3001\u30b7\u30fc\u30f3\u69cb\u6210\u3057\u3060\u3044\u3067\u306f\u305d\u3046\u305d\u3046\u5358\u7d14\u306b\u306f\u3044\u304b\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u8003\u3048\u65b9\u306e\u65b9\u5411\u6027\u3068\u3057\u3066\u300c\u5404\u30b7\u30fc\u30f3\u3092\u958b\u3044\u305f\u3068\u304d\u306b\u5fc5\u8981\u306a\u521d\u671f\u5316\u3092\u884c\u3046\u3088\u3046\u306b\u3059\u308b\u300d\u3068\u3044\u3046\u3053\u3068\u3092\u6291\u3048\u3066\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3054\u3068\u306b\u5fdc\u7528\u3057\u3066\u304a\u3051\u3070\u3088\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>DontDestroyOnLoad\u306f\u975e\u63a8\u5968\uff1f<\/h3>\n<p>\u3055\u3066\u3001DontDestroyOnLoad\u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u306f\u3001\u9577\u3044\u9593\uff08\u304a\u305d\u3089\u304f\u4eca\u3067\u3082\uff09\u5b9a\u756a\u306e\u4e00\u3064\u3060\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u5b9f\u306f<a href=\"https:\/\/docs.unity3d.com\/ja\/current\/Manual\/MultiSceneEditing.html\">Unity\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8<\/a>\u306b\u306f\u975e\u63a8\u5968\u3068\u3044\u3046\u65e8\u306e\u8a18\u8ff0\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u65e5\u672c\u8a9e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u3061\u3087\u3063\u3068\u8a33\u304c\u8352\u3044\u306e\u3067\u3059\u304c\u3001\u539f\u6587\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059<\/p>\n<blockquote>\n<p>It is recommended to avoid using DontDestroyOnLoad to persist manager GameObjects that you want to survive across scene loads. Instead, create a manager scene that has all your managers and use SceneManager.LoadScene(&quot;path&quot;, LoadSceneMode.Additive) and SceneManager.UnloadScene to manage your game progress.<\/p>\n<\/blockquote>\n<p>\u306a\u306e\u3067\u3001\u8a33\u3068\u3057\u3066\u306f\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n<strong>\u30b7\u30fc\u30f3\u30ed\u30fc\u30c9\u3092\u307e\u305f\u3044\u3067\u751f\u304d\u6b8b\u3089\u305b\u305f\u3044\u30de\u30cd\u30fc\u30b8\u30e3\u30fcGameObjects\u306b\u3001 DontDestroyOnLoad \u3092\u4f7f\u7528\u3059\u308b\u306e\u306f\u907f\u3051\u308b\u3053\u3068\u3092\u63a8\u5968\u3057\u307e\u3059\u3002\u4ee3\u308f\u308a\u306b\u3001\u3059\u3079\u3066\u306e\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u3092\u6301\u3063\u305f<strong>\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3<\/strong>\u3092\u4f5c\u6210\u3057\u3001SceneManager.LoadScene(&quot;path&quot;,LoadSceneMode.Additive) \u3068 SceneManager.UnloadScene \u3092\u4f7f\u3063\u3066\u3001\u30b2\u30fc\u30e0\u306e\u9032\u884c\u3092\u7ba1\u7406\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><\/p>\n<p>\u3088\u307b\u3069\u7279\u6b8a\u306a\u30b1\u30fc\u30b9\u3067\u3082\u306a\u3044\u9650\u308a\u3001DontDestroyOnLoad\u3092\u4f7f\u308f\u305a\u306bLoadSceneMode.Single\u3067\u30b2\u30fc\u30e0\u30a2\u30d7\u30ea\u3092\u8a2d\u8a08\u3059\u308b\u306e\u306f\u7121\u7406\u3060\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001<br \/>\n\u5b9f\u8cea\u306fLoadSceneMode.Single\u3092\u4f7f\u308f\u305a\u306b\u3001LoadSceneMode.Additive\u3092\u4f7f\u3046\u306e\u304c\u63a8\u5968\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u306a\u305c\u306a\u306e\u304b\u306e\u7406\u7531\u304c\u66f8\u3044\u3066\u3044\u306a\u3044\u306e\u3067\u4f55\u3068\u3082\u8a00\u3048\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u304a\u305d\u3089\u304f\u306fDontDestroy\u306b\u3057\u305fGameObject\u306fSceneManager\uff08\u5f8c\u8ff0\uff09\u7d4c\u7531\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u305d\u308c\u3092\u907f\u3051\u308b\u305f\u3081\u3060\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u500b\u4eba\u7684\u306b\u306fDontDestroyOnLoad\u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u306f\u7c21\u4fbf\u3055\u3068\u3044\u3046\u70b9\u3067\u3082\u5341\u5206\u6709\u7528\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u8907\u6570\u306e\u30b7\u30fc\u30f3\u3092\u540c\u6642\u306b\u30ed\u30fc\u30c9\u3057\u3066\u304a\u3051\u308b\u3000LoadSceneMode.Additive<\/h2>\n<h3>\u6982\u8981<\/h3>\n<p>LoadScene\uff08\u307e\u305f\u306fLoadSceneAsync\uff09\u3067\u7b2c\u4e8c\u5f15\u6570\u3092\u300cLoadSceneMode.Additive\u300d\u3068\u3059\u308b\u3068\u3001\u524d\u306e\u30b7\u30fc\u30f3\u306f\u6b8b\u3063\u305f\u307e\u307e\u3067\u305d\u308c\u306b\u8ffd\u52a0\u3057\u3066\u65b0\u305f\u306a\u30b7\u30fc\u30f3\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<br \/>\n\u3064\u307e\u308a\u3001\u540c\u6642\u306b\u8907\u6570\u306e\u30b7\u30fc\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3068\u3044\u3046\u4f7f\u3044\u65b9\u3067\u3059\u3002<br \/>\n\u3053\u306e\u3084\u308a\u65b9\u306f\u52a0\u7b97\u30b7\u30fc\u30f3\u306a\u3069\u3068\u547c\u3070\u308c\u308b\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre><code class=\"language-csharp\">using UnityEngine;\nusing UnityEngine.SceneManagement;\n\npublic class Sample : MonoBehaviour\n{\n\n    public void OnLoadSceneAdditive()\n    {\n        \/\/SceneB\u3092\u52a0\u7b97\u30ed\u30fc\u30c9\u3002\u73fe\u5728\u306e\u30b7\u30fc\u30f3\u306f\u6b8b\u3063\u305f\u307e\u307e\u3067\u3001\u30b7\u30fc\u30f3B\u304c\u8ffd\u52a0\u3055\u308c\u308b\n        SceneManager.LoadScene(&quot;SceneB&quot;,LoadSceneMode.Additive);\n    }\n}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1083.png\" width=700><\/p>\n<p>Unity\u306e\u30d2\u30a8\u30e9\u30eb\u30ad\u30fc\u30a6\u30a3\u30f3\u30c9\u30a6\u3067\u3082\u3001\u3053\u306e\u3088\u3046\u306b\u4e8c\u3064\u306e\u30b7\u30fc\u30f3\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1074.png\" alt=\"\" \/><\/p>\n<p>\u524d\u306e\u30b7\u30fc\u30f3\u306f\u6b8b\u3063\u305f\u307e\u307e\u52d5\u3044\u3066\u3044\u307e\u3059\u3057\u4e21\u65b9\u3068\u3082\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u30a2\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u308a\u3001\u975e\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u3057\u305f\u308a\u975e\u8868\u793a\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u306f\u30b7\u30fc\u30f3B\u3092\u30ed\u30fc\u30c9\u3059\u308b\u524d\u306e\u6bb5\u968e\u3067\u30d5\u30a7\u30fc\u30c9\u30a2\u30a6\u30c8\u306a\u3069\u3057\u3066\u3067\u4e00\u90e8\u306e\u51e6\u7406\u3092\u6b62\u3081\u305f\u308a\u975e\u8868\u793a\u306b\u3057\u3066\u304b\u3089\u30ed\u30fc\u30c9\u3059\u308b\u307b\u3046\u304c\u591a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u524d\u306e\u30b7\u30fc\u30f3\u304c\u6b8b\u3063\u305f\u307e\u307e\u306a\u306e\u3067\u3001\u305d\u308c\u306a\u308a\u306b\u624b\u9593\u3092\u304b\u3051\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u3059\u304c\u3001LoadSceneMode.Single\u3068\u9055\u3063\u3066\u300c\u3055\u3063\u304d\u306e\u72b6\u614b\u306b\u5fa9\u5e30\u3059\u308b\u300d\u3068\u3044\u3046\u306e\u306f\u6bd4\u8f03\u7684\u3084\u308a\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<p>\u975e\u30a2\u30af\u30c6\u30a3\u30d6\u3084\u975e\u8868\u793a\u3067\u306f\u306a\u304f\u3001\u30b7\u30fc\u30f3\u3092\u30a2\u30f3\u30ed\u30fc\u30c9\uff08\u6d88\u3057\u3066\u3057\u307e\u3046\uff09\u306b\u306f\u3001<a href=\"https:\/\/docs.unity3d.com\/ja\/2017.4\/ScriptReference\/SceneManagement.SceneManager.UnloadSceneAsync.html\">SceneManager.UnloadSceneAsync<\/a>\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n\u30a2\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u3060\u3051\u3060\u3068\u3001\u305d\u306e\u30b7\u30fc\u30f3\u3060\u3051\u3067\u4f7f\u3063\u3066\u3044\u305f\u30ea\u30bd\u30fc\u30b9\uff08\u30a2\u30bb\u30c3\u30c8\uff09\u306f\u30a2\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u306a\u3044\u306e\u3067\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066Resources.UnloadUnusedAssets\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\nResources.UnloadUnusedAssets\u306b\u3064\u3044\u3066\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre><code class=\"language-csharp\">using UnityEngine;\nusing UnityEngine.SceneManagement;\npublic class Sample : MonoBehaviour\n{\n    public void OnUnloadScene()\n    {\n        StartCoroutine(CoUnload());\n    }\n\n    IEnumerator CoUnload()\n    {\n        \/\/SceneA\u3092\u30a2\u30f3\u30ed\u30fc\u30c9\n        var op = SceneManager.UnloadSceneAsync(&quot;SceneA&quot;);\n        yield return op;\n\n       \/\/\u30a2\u30f3\u30ed\u30fc\u30c9\u5f8c\u306e\u51e6\u7406\u3092\u66f8\u304f\n\n        \/\/\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4e0d\u4f7f\u7528\u30a2\u30bb\u30c3\u30c8\u3092\u30a2\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30e1\u30e2\u30ea\u3092\u89e3\u653e\u3059\u308b\n        \/\/\u3051\u3063\u3053\u3046\u91cd\u3044\u51e6\u7406\u306a\u306e\u3067\u3001\u5225\u306b\u7ba1\u7406\u3059\u308b\u306e\u3082\u624b\n        yield return Resources.UnloadUnusedAssets();\n     }\n}\n<\/code><\/pre>\n<h3>\u5b9f\u88c5\u30d1\u30bf\u30fc\u30f3<\/h3>\n<h4>\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u3092\u5e38\u99d0\u3055\u305b\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8ffd\u52a0\u306e\u30b7\u30fc\u30f3\u3092\u30ed\u30fc\u30c9\u30fb\u30a2\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3000<\/h4>\n<p>\u7c21\u5358\u306a\u5b9f\u88c5\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u304b\u3089\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3001\u3042\u3068\u306f\u30b2\u30fc\u30e0\u306eUI\u9077\u79fb\u306a\u3069\u5fdc\u3058\u3066\u9806\u756a\u306b\u30b7\u30fc\u30f3\u3092\u52a0\u7b97\u3067\u30ed\u30fc\u30c9\u3068\u30a2\u30f3\u30ed\u30fc\u30c9\u3092\u3057\u3066\u3044\u304f\u3053\u3068\u3067\u3059\u3002<br \/>\n\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u306f\u30a2\u30f3\u30ed\u30fc\u30c9\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3060\u3051\u3067\u3001\u5e38\u306b\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u306e\u30aa\u30f3\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u30b2\u30fc\u30e0\u4e2d\u306b\u5b58\u5728\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1084.png\" width=700><\/p>\n<h4>\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u3092\u8d77\u52d5\u30b7\u30fc\u30f3\u306b\u56fa\u5b9a\u3057\u306a\u3044\u3000<\/h4>\n<p>DontDestroyOnLoad\u306e\u6642\u3068\u540c\u3058\u8a71\u3067\u3059\u304c\u3001\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u4ee5\u5916\u306e\u30b7\u30fc\u30f3\u304b\u3089\u3082\u8d77\u52d5\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3068\u30c6\u30b9\u30c8\u30d7\u30ec\u30a4\u304c\u697d\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u5404\u30b7\u30fc\u30f3\u306b\u4e0b\u8a18\u306e\u3088\u3046\u306a\u300c\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u30921\u5ea6\u3060\u3051\u81ea\u52d5\u7684\u306b\u30ed\u30fc\u30c9\u3059\u308b\u300d\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3001<br \/>\n\u305d\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5404\u30b7\u30fc\u30f3\u306b\u8a2d\u5b9a\u3059\u308b\u3068\u3001\u3069\u306e\u30b7\u30fc\u30f3\u304b\u3089\u958b\u59cb\u3057\u3066\u3082\u81ea\u52d5\u7684\u306b\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u3082\u4e00\u7dd2\u306b\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre><code class=\"language-csharp\">using UnityEngine;\nusing UnityEngine.SceneManagement;\n\npublic class ManagerSceneLoader : MonoBehaviour\n{\n    private static bool Loaded { get; set; }\n\n    void Awake()\n    {\n        if(Loaded) return;\n\n        Loaded = true;\n        SceneManager.LoadScene(&quot;ManagerScene&quot;, LoadSceneMode.Additive);\n    }\n}\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1086.png\" width=700><\/p>\n<p>\u5b9f\u969b\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3084\u30b7\u30fc\u30f3\u306e\u69cb\u6210\u6b21\u7b2c\u3067\u521d\u671f\u5316\u306e\u6d41\u308c\u3092\u8abf\u6574\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u7279\u306b\u3001\u5404\u30b7\u30fc\u30f3\u5185\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306fAwake\u6642\u306a\u3069\u306b\u3001\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u304c\u30ed\u30fc\u30c9\u6e08\u307f\u3068\u306f\u9650\u3089\u306a\u3044\u306e\u3067\u3001\u305d\u306e\u70b9\u304c\u30cd\u30c3\u30af\u306b\u306a\u308b\u30b1\u30fc\u30b9\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<h4>\u30b7\u30fc\u30f3\u3092\u30a2\u30f3\u30ed\u30fc\u30c9\u305b\u305a\u306b\u975e\u8868\u793a\u306b\u3059\u308b\u3060\u3051<\/h4>\n<p>\u6163\u308c\u3066\u304d\u305f\u3089\u3001UI\u30b7\u30fc\u30f3\u306a\u3069\u306f\u753b\u9762\u3054\u3068\u306b\u308f\u3051\u3066\u4f5c\u6210\u3057\u3001\u30b2\u30fc\u30e0\u8d77\u52d5\u6642\u306b\u3059\u3079\u3066\u30ed\u30fc\u30c9\u3057\u3066\u304a\u3044\u3066\u3001\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u8868\u793a\u30fb\u975e\u8868\u793a\u3092\u5207\u308a\u66ff\u3048\u308b\u3068\u3044\u3046\u624b\u6cd5\u3092\u3068\u308b\u3068\u3044\u3063\u305f\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1087.png\" width=700><\/p>\n<p>\u305f\u3060\u3001\u8907\u6570\u30b7\u30fc\u30f3\u306b\u9650\u3063\u305f\u8a71\u3067\u306f\u306a\u3044\u3067\u3059\u304c\u3001Unity\u306b\u306f\u57fa\u672c\u7684\u306b\u306f\u7279\u5b9a\u306e\u6a5f\u80fd\u3092\u4e2d\u65ad\u30fb\u518d\u958b\u3059\u308b\u3088\u3046\u306a\u6c4e\u7528\u7684\u306a\u4ed5\u7d44\u307f\u304c\u3042\u308b\u308f\u3051\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u7279\u306b\u3001GameObject\u3092\u975e\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u3057\u305f\u5834\u5408\u306f\u3001\u30b3\u30eb\u30fc\u30c1\u30f3\u304c\u6b62\u307e\u3063\u3066\u3057\u307e\u3044\u518d\u958b\u3067\u304d\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u6050\u308c\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u70b9\u306f\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u7570\u306a\u308b\u30b7\u30fc\u30f3\u9593\u3067\u306e\u30c7\u30fc\u30bf\u306e\u3084\u308a\u53d6\u308a<\/h2>\n<p>\u3055\u3066\u3001Single\u306b\u3057\u3066\u3082Additive\u306b\u3057\u3066\u3082\u3001\u8907\u6570\u30b7\u30fc\u30f3\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u300c\u4ed6\u306e\u30b7\u30fc\u30f3\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53c2\u7167\u3059\u308b\u300d\u3068\u3044\u3046\u3053\u3068\u304c\u5fc5\u9808\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nUnity\u306f\u30b7\u30fc\u30f3\u7de8\u96c6\u6642\u3082<a href=\"https:\/\/docs.unity3d.com\/jp\/current\/Manual\/MultiSceneEditing.html\">\u8907\u6570\u30b7\u30fc\u30f3\u3092\u30ed\u30fc\u30c9\u3057\u3066\u540c\u6642\u306b\u7de8\u96c6\u53ef\u80fd<\/a>\u3067\u3059\u304c\u3001\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u30fc\u306a\u3069\u306b\u307b\u304b\u306e\u30b7\u30fc\u30f3\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u6b63\u78ba\u306b\u8a00\u3046\u3068\u3001\u30bb\u30fc\u30d6\u3067\u304d\u305a\u306b\u7121\u52b9\u3067\u3042\u308b\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u3001\u30b2\u30fc\u30e0\u30d7\u30ec\u30a4\u6642\u306b\u5229\u7528\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u306a\u306e\u3067\u3001\u5225\u306e\u624b\u6bb5\u304c\u5fc5\u8981\u3068\u306a\u308a\u307e\u3059\u3002\u4ee3\u8868\u7684\u306a\u624b\u6bb5\u3092\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<h3>SceneManager\u3092\u6d3b\u7528<\/h3>\n<p><a href=\"https:\/\/docs.unity3d.com\/ja\/current\/ScriptReference\/SceneManagement.SceneManager.html\">SceneManager<\/a>\u306b\u306f\u30ed\u30fc\u30c9\u3055\u308c\u305f\u30b7\u30fc\u30f3\u3092\u53d6\u5f97\u3059\u308b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3053\u308c\u3092\u4f7f\u3063\u3066\u307b\u304b\u306e\u30b7\u30fc\u30f3\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u305f\u3068\u3048\u3070\u3001Manager\u30b7\u30fc\u30f3\u306e\u76f4\u4e0b\u306b\u3042\u308bGameManager\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u53d6\u5f97\u3057\u305f\u3044\u306e\u3067\u3042\u308c\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308c\u3070\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1089.png\" alt=\"\" \/><\/p>\n<p><strong>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre><code class=\"language-csharp\">using UnityEngine;\nusing UnityEngine.SceneManagement;\n\npublic class SceneManagerSample : MonoBehaviour\n{\n    public void OnAccessGameManager()\n    {\n        \/\/\u30ed\u30fc\u30c9\u6e08\u307f\u306e\u30b7\u30fc\u30f3\u3067\u3042\u308c\u3070\u3001\u540d\u524d\u3067\u5225\u30b7\u30fc\u30f3\u3092\u53d6\u5f97\u3067\u304d\u308b\n        Scene scene = SceneManager.GetSceneByName(&quot;ManagerScene&quot;);\n\n        \/\/GetRootGameObjects\u3067\u3001\u305d\u306e\u30b7\u30fc\u30f3\u306e\u30eb\u30fc\u30c8GameObjects\n        \/\/\u3064\u307e\u308a\u3001\u30d2\u30a8\u30e9\u30eb\u30ad\u30fc\u306e\u6700\u4e0a\u4f4d\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u53d6\u5f97\u3067\u304d\u308b\n        foreach (var rootGameObject in scene.GetRootGameObjects())\n        {\n            GameManager gameManager = rootGameObject.GetComponent&lt;GameManager&gt;();\n            if (gameManager != null)\n            {\n                \/\/GameManager\u304c\u898b\u3064\u304b\u3063\u305f\u306e\u3067\n                \/\/gameManager\u306e\u30b9\u30b3\u30a2\u3092\u53d6\u5f97\n                Debug.Log( &quot;\u30b9\u30b3\u30a2\u306f&quot; + gameManager.Score + &quot;\u3067\u3059&quot;);\n                break;\n            }\n        }\n    }\n}\n<\/code><\/pre>\n<p>\u30eb\u30fc\u30c8\u306b\u306a\u3044\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u62fe\u3063\u3066\u304d\u305f\u3044\u3068\u304d\u306f\u3001GetComponentInChildren\u3092\u4f7f\u3046\u306a\u3069\u3057\u3066\u5fdc\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\nSceneManager\u306b\u306f\u4ed6\u306b\u3082\u3044\u304f\u3064\u304b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u3048\u3070\u300c\u5168\u30b7\u30fc\u30f3\u304b\u3089\u3001\u6307\u5b9a\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u691c\u7d22\u300d\u306a\u3093\u3066\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u8a73\u3057\u304f\u306f\u3001<a href=\"https:\/\/docs.unity3d.com\/ja\/current\/ScriptReference\/SceneManagement.SceneManager.html\">SceneManager\u306e\u516c\u5f0f\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9<\/a>\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u5358\u7d14\u306b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u53d6\u5f97\u3059\u308b\u3060\u3051\u3067\u3082\u3001\u3051\u3063\u3053\u3046\u9577\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u3042\u308b\u7a0b\u5ea6\u81ea\u5206\u306a\u308a\u306b\u62e1\u5f35\u3057\u305f\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u30af\u30e9\u30b9\u306e\u3088\u3046\u306a\u3082\u306e\u3092\u4f5c\u3063\u3066\u3057\u307e\u3063\u305f\u307b\u3046\u304c\u3088\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<h4>SceneManager\u306fDontDestroyOnLoad\u30b7\u30fc\u30f3\u306b\u306f\u4f7f\u3048\u306a\u3044<\/h4>\n<p>SceneManager\u306fDontDestroyOnLoad\u30b7\u30fc\u30f3\u306b\u306f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\nUnity\u304c\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092DontDestroyOnLoad\u306b\u3059\u308b\u8a2d\u8a08\u3092\u975e\u63a8\u5968\u306b\u3057\u3066\u308b\u306e\u306f\u3001\u3053\u306e\u305b\u3044\u3060\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001DontDestroyOnLoad\u3092\u4f7f\u3063\u305f\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u3057\u3066\u3044\u308b\u3082\u306e\u306f\u5225\u306e\u624b\u6bb5\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u30d1\u30bf\u30fc\u30f3\u3092\u6d3b\u7528<\/h3>\n<p>\u3082\u3063\u3068\u5b9a\u756a\u306a\u306e\u306f\u3001\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u3046\u3053\u3068\u3067\u3059\u3002<br \/>\n\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u30d1\u30bf\u30fc\u30f3\u3068\u3044\u3046\u306e\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u5168\u822c\u3067\u4f7f\u308f\u308c\u308b\u7528\u8a9e\u3067\u3059\u3002\u305d\u3061\u3089\u306b\u3064\u3044\u3066\u306e\u8a73\u7d30\u306f\u8ff0\u3079\u307e\u305b\u3093\u306e\u3067\u8208\u5473\u304c\u3042\u308b\u4eba\u306f\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3053\u3053\u3067\u3044\u3046\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u30d1\u30bf\u30fc\u30f3\u306f\u300cUnity\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\uff08MonoBehaviour\uff09\u3092\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u30d1\u30bf\u30fc\u30f3\u3067\u5b9f\u88c5\u3057\u3001\u305d\u308c\u3092\u4f7f\u3063\u3066\u5225\u30b7\u30fc\u30f3\u540c\u58eb\u3067\u53c2\u7167\u3092\u53ef\u80fd\u306b\u3059\u308b\u300d\u3068\u3044\u3046\u3082\u306e\u3067\u3059\u3002<br \/>\nSceneManager\u304c\u3067\u304d\u308b\u4ee5\u524d\u304b\u3089\u3001Unity\u3067\u30b7\u30fc\u30f3\u9593\u306e\u30c7\u30fc\u30bf\u53c2\u7167\u306b\u306f\u3060\u3044\u305f\u3044\u3053\u308c\u304c\u4f7f\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306f\u3001\u3069\u3053\u304b\u3089\u3067\u3082\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308b\u53cd\u9762\u3001\u300c\u30b2\u30fc\u30e0\u4e2d\u306b\u540c\u3058\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u3082\u306e\u306f1\u3064\u3060\u3051\u3057\u304b\u4f5c\u3063\u3066\u306f\u3044\u3051\u306a\u3044\u300d\u3068\u3044\u3046\u5236\u7d04\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001\u30b5\u30a6\u30f3\u30c9\u30de\u30cd\u30fc\u30b8\u30e3\u3084\u30b2\u30fc\u30e0\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306e\u3088\u3046\u306a\u300c\u30b2\u30fc\u30e0\u4e2d\u30671\u3064\u3057\u304b\u306a\u304f\u3044\u308d\u3044\u308d\u306a\u3068\u3053\u308d\u304b\u3089\u53c2\u7167\u3055\u308c\u308b\u5171\u901a\u306e\u4ed5\u7d44\u307f\u300d\u3092\u5b9f\u88c5\u3059\u308b\u306e\u306b\u5411\u3044\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4f5c\u308a\u65b9\u306f\u30cd\u30c3\u30c8\u4e0a\u306b\u3082\u305f\u304f\u3055\u3093\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u6539\u3081\u3066\u8f09\u305b\u308b\u3068\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p><strong>\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306e\u3072\u306a\u578b\u3068\u306a\u308b\u57fa\u5e95\u30af\u30e9\u30b9\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/strong><\/p>\n<pre><code class=\"language-csharp\">    \/\/\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306aMonoBehaviour\u306e\u57fa\u5e95\u30af\u30e9\u30b9\n    public class SingletonMonoBehaviour&lt;T&gt; : MonoBehaviour where T : MonoBehaviour\n    {\n        static T instance;\n        public static T Instance\n        {\n            get\n            {\n                if (instance != null) return instance;\n                instance = (T)FindObjectOfType(typeof(T));\n\n                if (instance == null)\n                {\n                    Debug.LogError(typeof(T) + &quot;is nothing&quot;);\n                }\n\n                return instance;\n            }\n        }\n\n        public static T InstanceNullable\n        {\n            get\n            {\n                return instance;\n            }\n        }\n\n        protected virtual void Awake()\n        {\n            if (instance != null &amp;&amp; instance != this)\n            {\n                Debug.LogError(typeof(T) + &quot; is multiple created&quot;, this);\n                return;\n            }\n\n            instance = this as T;\n        }\n\n        protected virtual void OnDestroy()\n        {\n            if (instance == this)\n            {\n                instance = null;\n            }\n        }\n    }\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u3067\u4f5c\u3063\u305f\u30af\u30e9\u30b9\u3092\u7d99\u627f\uff08C#\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4ed5\u7d44\u307f\u3067\u3059\uff09\u3059\u308b\u3053\u3068\u3067\u3001GameManager\u306a\u3069\u81ea\u5206\u306e\u4f5c\u3063\u305f\u597d\u304d\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><strong>\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306aGameManager\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/strong><\/p>\n<pre><code class=\"language-csharp\">\/\/SingletonMonoBehaviour\u3092\u7d99\u627f\u3057\u305f\u3001\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306aGameManager\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\npublic class GameManager : SingletonMonoBehaviour&lt;GameManager&gt;\n{\n    public int Score { get; set; } \n}\n<\/code><\/pre>\n<p>\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306b\u3057\u305f\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u3001\u3069\u306e\u30b7\u30fc\u30f3\u304b\u3089\u3067\u3082\u3053\u306e\u3088\u3046\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-csharp\">        void OnAccessGameManger()\n        {\n            \/\/\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u540d.Instance\u3067\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u53d6\u5f97\u3067\u304d\u308b\n            GameManager gameManager = GameManager.Instance;\n\n            \/\/GameManager\u306e\u30b9\u30b3\u30a2\u3092\u8868\u793a\n            Debug.Log( gameManager.Score);\n        }\n<\/code><\/pre>\n<p>\u3082\u3068\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u3042\u308b\u30b7\u30fc\u30f3\u304c\u307e\u3060\u30ed\u30fc\u30c9\u3055\u308c\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u3001\u5f53\u7136\u3067\u3059\u304c\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u5b9f\u969b\u306b\u4f7f\u3046\u3068\u304d\u306f\u30ed\u30fc\u30c9\u3084\u521d\u671f\u5316\u306e\u9806\u756a\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u307e\u305f\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u3044\u3046\u554f\u984c\u304c\u3064\u304d\u307e\u3068\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3061\u3087\u3063\u3068\u6839\u6df1\u3044\u306e\u3067\u3055\u3089\u306b\u5f8c\u3067\u8a73\u3057\u304f\u8ff0\u3079\u307e\u3059\u3002<\/p>\n<h3>ScriptabelObject\u3092\u6d3b\u7528<\/h3>\n<p>\u3055\u3066\u3001\u3042\u307e\u308a\u30e1\u30b8\u30e3\u30fc\u3067\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001ScriptabelObject\u3092\u4f7f\u3046\u3068\u3044\u3046\u624b\u6cd5\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001\u3053\u308c\u306f\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u30b2\u30fc\u30e0\u306e\u8a2d\u8a08\u65b9\u91dd\u305d\u306e\u3082\u306e\u304b\u3089\u5909\u3048\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u3082\u3042\u308b\u306e\u3067\u3042\u3048\u3066\u4f7f\u3046\u5fc5\u8981\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>ScriptabelObject\u81ea\u4f53\u3042\u307e\u308a\u4f7f\u3063\u3066\u306a\u3044\u4eba\u3082\u591a\u3044\u3068\u306f\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u306f\u30a4\u30e1\u30fc\u30b8\u3068\u3057\u3066\u306f\u300c\u30c7\u30fc\u30bf\u306e\u56fa\u307e\u308a\u300d\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3001<br \/>\n\u30b7\u30fc\u30f3\u5185\u3067\u306f\u306a\u304f\u30c6\u30af\u30b9\u30c1\u30e3\u3084\u30b5\u30a6\u30f3\u30c9\u306e\u30ea\u30bd\u30fc\u30b9\u306a\u3069\u3068\u540c\u3058\u3088\u3046\u306bProjectWindow\u5185\u306b\u4f5c\u6210\u3055\u308c\u308b\u3082\u306e\u3067\u3059\u3002<br \/>\n\u30c6\u30af\u30b9\u30c1\u30e3\u304c\u5225\u3005\u306e\u30b7\u30fc\u30f3\u3067\u3082\u540c\u3058\u3082\u306e\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3001ScriptabelObject\u3082\u5225\u3005\u306e\u30b7\u30fc\u30f3\u3067\u3042\u3063\u3066\u3082\u540c\u3058\u3082\u306e\u3092\u4f7f\u3048\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u3001\u3053\u3053\u304cScriptabelObject\u306e\u6700\u5927\u306e\u7279\u5fb4\u306a\u306e\u3067\u3059\u304c\u3001\u30c7\u30fc\u30bf\u3060\u3051\u3067\u306f\u306a\u304f\u30ed\u30b8\u30c3\u30af\u3092\u6301\u305f\u305b\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\n\u306a\u306e\u3067\u3001\u305d\u308c\u3092\u5229\u7528\u3057\u3066\u30b7\u30fc\u30f3\u9593\u3067\u30c7\u30fc\u30bf\u306e\u3084\u308a\u53d6\u308a\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>ScriptabelObject\u306f\u30a8\u30c7\u30a3\u30bf\u62e1\u5f35\u3084Unity.Object\u306e\u30b7\u30ea\u30a2\u30e9\u30a4\u30ba\u306b\u3082\u7d61\u3093\u3067\u304f\u308b\u305f\u3081\u3001\u5fc5\u8981\u3068\u3055\u308c\u308bUnity\u3078\u306e\u7406\u89e3\u5ea6\u304c\u9ad8\u3044\u3067\u3059\u3002<br \/>\n\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u306f\u4e0b\u8a18\u306e\u30b5\u30a4\u30c8\u306a\u3069\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u521d\u5fc3\u8005\u5411\u304d\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u4e0b\u8a18\u306e\u30ea\u30f3\u30af\u3092\u898b\u3066\u300c\u306a\u308b\u307b\u3069\u308f\u304b\u3063\u305f\u8a66\u3057\u3066\u307f\u3088\u3046\u300d\u3068\u3044\u3046\u304f\u3089\u3044\u306e\u7406\u89e3\u5ea6\u304c\u3042\u3063\u3066\u306f\u3058\u3081\u3066\u6311\u6226\u3057\u305f\u3057\u305f\u307b\u3046\u304c\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n<a href=\"http:\/\/tsubakit1.hateblo.jp\/entry\/2017\/06\/19\/233000\">ScriptableObject\u3092\u4f7f\u7528\u3057\u305f\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u30fb\u30b7\u30fc\u30f3\u9593\u3067\u306e\u30c7\u30fc\u30bf\u5171\u6709\u306b\u3064\u3044\u3066<\/a><br \/>\n<a href=\"https:\/\/forpro.unity3d.jp\/unity_pro_tips\/2019\/07\/27\/57\/\">Unity Pro Tips &gt; \u30aa\u30d5\u30a3\u30b7\u30e3\u30eb\u8a18\u4e8b &gt; DEVELOPER &gt; \u30b2\u30fc\u30e0\u69cb\u7bc9\u3092\u5287\u7684\u306b\u30b9\u30de\u30fc\u30c8\u306b\u3059\u308b Scriptable Object\u306e 3\u3064\u306e\u6d3b\u7528\u65b9\u6cd5<\/a><br \/>\n<a href=\"https:\/\/forpro.unity3d.jp\/unity_pro_tips\/2019\/10\/30\/288\/\">Unity Pro Tips &gt; \u30aa\u30d5\u30a3\u30b7\u30e3\u30eb\u8a18\u4e8b &gt; DEVELOPER &gt; \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u5927\u898f\u6a21\u5316\u3057\u3066\u3082\u30b3\u30fc\u30c9\u3092\u6574\u7136\u3068\u3057\u305f\u72b6\u614b\u306b\u4fdd\u3064\u30b3\u30c4<\/a><br \/>\n<a href=\"https:\/\/blogs.unity3d.com\/jp\/2020\/07\/01\/achieve-better-scene-workflow-with-scriptableobjects\/\">Unity\u30d6\u30ed\u30b0 ScriptableObject \u3092\u4f7f\u3063\u3066\u30b7\u30fc\u30f3\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u3092\u6539\u5584\u3057\u3088\u3046<\/a><\/p>\n<h3>GameObject.Find\u3092\u6d3b\u7528<\/h3>\n<p><a href=\"https:\/\/docs.unity3d.com\/ja\/current\/ScriptReference\/GameObject.Find.html\">GameObject.Find<\/a>\u3092\u4f7f\u3046\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\u691c\u7d22\u5bfe\u8c61\u306f\u5168\u3066\u306e\u30b7\u30fc\u30f3\u306a\u306e\u3067\u3001\u5bfe\u8c61\u306e\u540d\u524d\u3055\u3048\u308f\u304b\u3063\u3066\u3044\u308b\u306a\u3089\u3053\u308c\u3092\u4f7f\u3063\u3066\u63a2\u3059\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305f\u3060\u3001<a href=\"https:\/\/forum.unity.com\/threads\/multi-scene-editing-gameobject-find.381791\/\">GameObject.Find\u306f\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044<\/a>\u3088\u3046\u3067\u3059\u3002<br \/>\n\u5168\u30b7\u30fc\u30f3\u304b\u3089\u691c\u7d22\u3059\u308b\u306e\u3067\u51e6\u7406\u304c\u91cd\u3044\u3067\u3059\u3057\u3001\u540d\u524d\u304c\u5909\u66f4\u3055\u308c\u308b\u53ef\u80fd\u6027\u3084\u3001\u540c\u540d\u306e\u5225\u306eGameObject\u3092\u63a2\u3057\u3066\u304d\u3066\u3057\u307e\u3046\u5371\u967a\u306a\u3069\u304c\u3042\u3063\u3066\u4e0d\u5177\u5408\u3092\u751f\u3080\u3053\u3068\u3082\u3042\u308b\u304b\u3089\u3067\u3059\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u306f\u5225\u306e\u624b\u6bb5\u3092\u4f7f\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u304f\u306a\u308b\u554f\u984c\u3078\u306e\u5bfe\u7b56\u3000<\/h2>\n<p>\u8907\u6570\u30b7\u30fc\u30f3\u3092\u4f7f\u3063\u3066\u3044\u308b\u3068\u3001\u30e1\u30e2\u30ea\u3067\u554f\u984c\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3063\u3066\u3082\u8907\u6570\u30b7\u30fc\u30f3\u306b\u9650\u3089\u305aUnity\u306e\u958b\u767a\u3001\u3082\u3063\u3068\u3044\u3046\u3068\u30b2\u30fc\u30e0\u958b\u767a\u306b\u304a\u3044\u3066\u30e1\u30e2\u30ea\u7ba1\u7406\u306f\u3068\u3066\u3082\u91cd\u8981\u3067\u9762\u5012\u3067\u3059\u3002<br \/>\n\u30e1\u30e2\u30ea\u306b\u95a2\u3057\u3066\u5927\u96d1\u628a\u306b\u554f\u984c\u306b\u306a\u308b\u306e\u306f<br \/>\n\u30fb\u30e1\u30e2\u30ea\u78ba\u4fdd\u3092\u983b\u7e41\u306b\u884c\u3046\u305b\u3044\u3067\u554f\u984c\u304c\u304a\u304d\u308b\uff08\u51e6\u7406\u843d\u3061\u3084GC\u30b9\u30d1\u30a4\u30af\u3001\u65ad\u7247\u5316\u3001CPU\u30ad\u30e3\u30c3\u30b7\u30e5\u30d2\u30c3\u30c8\u7387\u306e\u4f4e\u4e0b\u306a\u3069\uff09<br \/>\n\u30fb\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u3044\uff08\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306a\u3069\u306e\u307b\u304b\u3001\u65ad\u7247\u5316\u306e\u5f71\u97ff\u3067\u8db3\u308a\u306a\u304f\u306a\u308b\u3053\u3068\u3082\u3042\u308b\uff09<br \/>\n\u3068\u3044\u3046\u4e8c\u70b9\u3067\u3059\u3002\u8907\u6570\u30b7\u30fc\u30f3\u3067\u7279\u6709\u306e\u554f\u984c\u304c\u8d77\u304d\u304c\u3061\u306a\u306e\u306f\u4e3b\u306b\u5f8c\u8005\u306a\u306e\u3067\u305d\u308c\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u8ff0\u3079\u307e\u3059\u3002<\/p>\n<p>\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306a\u3069\u3067\u306f\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u304f\u306a\u3063\u305f\u30a2\u30d7\u30ea\u306f\u5f37\u5236\u7d42\u4e86\u304c\u57fa\u672c\u3067\u3059\u3002<br \/>\n\u30e1\u30e2\u30ea\u78ba\u4fdd\u304c\u983b\u7e41\u306b\u8d77\u304d\u308b\u5834\u5408\u306f\u300c\u30b2\u30fc\u30e0\u304c\u30ab\u30af\u30ab\u30af\u3059\u308b\u300d\u3068\u3044\u3046\u7a0b\u5ea6\u3067\u3059\u307f\u307e\u3059\u304c\u3001\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u3044\u5834\u5408\u306f\u300c\u30d7\u30ec\u30a4\u4e2d\u306b\u5f37\u5236\u7d42\u4e86\u300d\u3068\u3044\u3046\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3057\u304b\u3082\u3001\u3055\u3089\u306b\u554f\u984c\u306a\u3053\u3068\u306b\u300c\u30e1\u30e2\u30ea\u304c\u8db3\u308a\u306a\u3044\u539f\u56e0\u300d\u3068\u3044\u3046\u306e\u3092\u898b\u3064\u3051\u308b\u306e\u306f\u304b\u306a\u308a\u96e3\u3057\u3044\u3067\u3059\u3002<br \/>\n\u306a\u305c\u304b\u3068\u3044\u3046\u3068\u3001\u300c\u30e1\u30e2\u30ea\u3092\u4f7f\u3044\u3059\u304e\u3066\u3044\u308b\u539f\u56e0\u300d\u3092\u7a4d\u307f\u91cd\u306d\u3066\u300c\u3053\u308c\u4ee5\u4e0a\u7121\u7406\uff01\u300d\u3068\u306a\u3063\u305f\u3068\u304d\u306b\u30a2\u30d7\u30ea\u304c\u5f37\u5236\u7d42\u4e86\u3059\u308b\u304b\u3089\u3067\u3059\u3002<br \/>\n\u901a\u5e38\u306e\u30d0\u30b0\u306e\u3088\u3046\u306b\u3001\u5f71\u97ff\u304c\u5373\u5ea7\u306b\u73fe\u308c\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u300c\u3044\u3064\u3069\u3053\u3067\u8d77\u304d\u305f\u304b\uff1f\u300d\u3068\u3044\u3046\u306e\u304c\u8ffd\u3044\u3065\u3089\u3044\u306e\u3067\u3059\u3002<br \/>\n\u30d7\u30ed\u30d5\u30a1\u30a4\u30e9\u30fc\u306a\u3069\u3092\u3046\u307e\u304f\u4f7f\u7528\u3059\u308c\u3070\u3001\u4f55\u304c\u3069\u308c\u304f\u3089\u3044\u30e1\u30e2\u30ea\u3092\u4f7f\u3063\u3066\u3044\u308b\u304b\u3092\u898b\u308c\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u81ea\u4f53\u304c\u4f7f\u3044\u65b9\u304c\u96e3\u3057\u304b\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u30d7\u30ed\u30d5\u30a1\u30a4\u30e9\u30fc\u3067\u300c\u3069\u308c\u304c\u539f\u56e0\u304b\u300d\u306f\u308f\u304b\u3063\u3066\u3082\u3001\u300c\u3044\u3064\u300d\u304c\u539f\u56e0\u304b\u306f\u308f\u304b\u308a\u307e\u305b\u3093\u3057\u3001\u300c\u306a\u305c\u300d\u8d77\u304d\u308b\u304b\u300c\u3069\u3046\u3059\u308c\u3070\u89e3\u6c7a\u3059\u308b\u304b\u300d\u306fUnity\u3084C#\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4ed5\u7d44\u307f\u3092\u77e5\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3057\u3066\u82e6\u52b4\u3057\u3066\u539f\u56e0\u3068\u6539\u5584\u7b56\u304c\u5206\u304b\u3063\u305f\u3068\u3057\u3066\u3082\u3001\u5f8c\u304b\u3089\u6539\u5584\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u69cb\u6210\u3092\u5909\u3048\u308b\u5fc5\u8981\u3059\u3089\u3042\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u30b2\u30fc\u30e0\u3067\u4f7f\u3048\u308b\u30e1\u30e2\u30ea\u306f\u30cf\u30fc\u30c9\u306b\u3088\u3063\u3066\u4f55\u500d\u3082\u9055\u3044\u304c\u3042\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u3059\u3093\u306a\u308a\u52d5\u3044\u3066\u308b\u5834\u5408\u306f\u4f55\u3082\u554f\u984c\u304c\u306a\u3044\u306e\u3067\u3001\u300c\u4f4e\u30b9\u30da\u30c3\u30af\u7aef\u672b\u306f\u8003\u616e\u3057\u306a\u3044\u300d\u3068\u304b\u300c\u9577\u6642\u9593\u30d7\u30ec\u30a4\u3067\u305f\u307e\u306b\u843d\u3061\u308b\u306e\u306f\u3057\u3087\u3046\u304c\u306a\u3044\u300d\u3068\u3044\u3046\u5272\u308a\u5207\u308a\u304c\u8a31\u3055\u308c\u308b\u306e\u3067\u3042\u308c\u3070\u3001\u3042\u307e\u308a\u6c17\u306b\u3057\u306a\u304f\u3066\u3088\u3044\u3067\u3059\u3002<br \/>\n\uff08\u305f\u3060\u3057\u3001\u30b2\u30fc\u30e0\u5c02\u7528\u6a5f\u306e\u5834\u5408\u306f\u51fa\u8377\u30c1\u30a7\u30c3\u30af\u306b\u901a\u3089\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\uff09<br \/>\n\u57fa\u672c\u7684\u306b\u306f\u5b89\u5b9a\u5316\u306e\u90e8\u985e\u306a\u306e\u3067\u3001\u5bfe\u7b56\u3057\u305f\u3068\u3053\u308d\u3067\u898b\u305f\u76ee\u304c\u3088\u304f\u306a\u308b\u308f\u3051\u3067\u3082\u52d5\u4f5c\u304c\u8efd\u304f\u306a\u308b\u308f\u3051\u3067\u3082\u306a\u3044\u304b\u3089\u3067\u3059\u3002<br \/>\n\u305d\u308c\u3088\u308a\u3082\u3001\u5225\u306e\u90e8\u5206\u306b\u52b4\u529b\u3092\u5272\u304f\u3068\u3044\u3046\u306e\u306f\u5341\u5206\u3042\u308a\u3046\u308b\u5224\u65ad\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305d\u3082\u305d\u3082\u30b2\u30fc\u30e0\u3067\u4f7f\u3048\u308b\u30e1\u30e2\u30ea\u5bb9\u91cf\u304c\u4e0d\u5b89\u5b9a\u306a\u74b0\u5883\u3067\u306f\u3001\u5b8c\u74a7\u306a\u5bfe\u5fdc\u306f\u4e8b\u5b9f\u4e0a\u4e0d\u53ef\u80fd\u3060\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002\u7a0b\u5ea6\u306e\u554f\u984c\u3067\u3059\u3002<br \/>\n\u8ab0\u3082\u304c\u77e5\u3063\u3066\u3044\u308b\u3088\u3046\u306a\u30e1\u30b8\u30e3\u30fc\u306a\u30b2\u30fc\u30e0\u3067\u3042\u3063\u3066\u3082\u3001\u3053\u306e\u554f\u984c\u304c\u983b\u7e41\u306b\u8d77\u3053\u308b\u3053\u3068\u3082\u3042\u3063\u305f\u308a\u3057\u307e\u3059\u306e\u3067\u3001<br \/>\n\u30ab\u30b8\u30e5\u30a2\u30eb\u30b2\u30fc\u30e0\u306a\u3069\u3067\u3069\u3053\u307e\u3067\u6c17\u306b\u3059\u3079\u304d\u304b\u306f\u5224\u65ad\u304c\u5fc5\u8981\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u8907\u6570\u30b7\u30fc\u30f3\u3067\u7279\u306b\u9665\u308a\u304c\u3061\u306a\u554f\u984c\u306b\u7d5e\u3063\u3066\u307e\u3068\u3081\u305f\u304f\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u3069\u3046\u3057\u3066\u3082\u30e1\u30e2\u30ea\u7ba1\u7406\u5168\u822c\u306e\u4ed5\u7d44\u307f\u306b\u8a00\u53ca\u305b\u3056\u308b\u3092\u5f97\u306a\u3044\u306e\u3067\u6b63\u76f4\u96e3\u89e3\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u672c\u5f53\u306e\u3068\u3053\u308d\u3092\u3044\u3046\u3068\u3001\u3053\u306e\u8a71\u306f\u8907\u96d1\u306a\u306e\u3067\u7701\u3053\u3046\u304b\u3068\u3082\u601d\u3044\u307e\u3057\u305f\u3002<br \/>\n\u305f\u3060\u3001\u5148\u8ff0\u3057\u305f\u6614\u307e\u3068\u3081\u305f\u3082\u306e\u304c\u300c\u30d0\u30c3\u30c9\u30ce\u30a6\u30cf\u30a6\u3068\u3044\u3046\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u53d7\u3051\u305f\u300d\u3068\u3044\u3046\u3068\u304d\u306e\u3001\u554f\u984c\u306e\u539f\u56e0\u3067\u3082\u3042\u308b\u306e\u3067\u4e00\u5fdc\u8a73\u3057\u304f\u8f09\u305b\u3066\u304a\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>\u4e0d\u4f7f\u7528\u30a2\u30bb\u30c3\u30c8\u3092\u30a2\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3000Resources.UnloadUnusedAssets<\/h3>\n<p>\u4eca\u6642\u306e\u30b2\u30fc\u30e0\u958b\u767a\u3067\u306f\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u81ea\u4f53\u304c\u4f7f\u7528\u3059\u308b\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u81ea\u4f53\u306f\u306f\u307b\u3068\u3093\u3069\u554f\u984c\u306b\u306a\u308a\u307e\u305b\u3093\u3002<br \/>\n\u305d\u308c\u3088\u308a\u3082\u3001\uff08\u7279\u306bUnity\u3067\u306f\uff09\u30c6\u30af\u30b9\u30c1\u30e3\u3084\u30b5\u30a6\u30f3\u30c9\u306a\u3069\u30ea\u30bd\u30fc\u30b9\u306e\u305f\u3081\u306b\u6d88\u8cbb\u3059\u308b\u30e1\u30e2\u30ea\u306e\u307b\u3046\u304c\u6841\u9055\u3044\u306b\u5927\u304d\u3044\u3067\u3059\u3002<br \/>\n\u8907\u6570\u30b7\u30fc\u30f3\u3092\u4f7f\u3063\u305f\u5b9f\u88c5\u306f\u3001\u4e00\u5ea6\u306b\u591a\u304f\u306e\u30ea\u30bd\u30fc\u30b9\u3092\u540c\u6642\u306b\u30ed\u30fc\u30c9\u3057\u3066\u3044\u308b\u72b6\u614b\u306b\u306a\u3063\u3066\u308b\u305f\u3081\u81ea\u7136\u3068\u30e1\u30e2\u30ea\u3092\u5927\u304d\u304f\u6d88\u8cbb\u3057\u304c\u3061\u3067\u3059\u3002<br \/>\n\u306a\u306e\u3067\u3001\u4f7f\u3044\u7d42\u308f\u3063\u305f\u30ea\u30bd\u30fc\u30b9\uff08\u30a2\u30bb\u30c3\u30c8\uff09\u306f\u9069\u5ea6\u306b\u89e3\u653e\u3057\u3066\u3044\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>Unity\u306e\u4e0d\u4f7f\u7528\u30a2\u30bb\u30c3\u30c8\u3092\u624b\u52d5\u3067\u30a2\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3001\u4f7f\u7528\u3057\u3066\u3044\u305f\u30e1\u30e2\u30ea\u3092\u89e3\u653e\u3059\u308b\u306b\u306f\u3001<a href=\"https:\/\/docs.unity3d.com\/ja\/current\/ScriptReference\/Resources.UnloadUnusedAssets.html\">Resources.UnloadUnusedAssets<\/a>\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<h4>\u4e0d\u4f7f\u7528\u30a2\u30bb\u30c3\u30c8\u306e\u30a2\u30f3\u30ed\u30fc\u30c9\u3000LoadSceneMode.Single\u306e\u5834\u5408\u306f\u81ea\u52d5<\/h4>\n<p>LoadSceneMode.Single\u306e\u5834\u5408\u3001\u30b7\u30fc\u30f3\u306e\u30ed\u30fc\u30c9\u304c\u7d42\u308f\u3063\u305f\u3068\u304d\u306bResources.UnloadUnusedAssets\u3068\u540c\u3058\u51e6\u7406\u304c\u81ea\u52d5\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u306e\u3067\u3001\u3042\u307e\u308a\u6c17\u306b\u3057\u306a\u304f\u3066\u3088\u3044\u3067\u3059\u3002<br \/>\n\uff08\u305f\u3060\u3057\u3001Unity\u306e\u30ea\u30d5\u30a1\u30ec\u30f3\u30b9\u3084\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u306f\u8a18\u8ff0\u304c\u306a\u3044\u306e\u3067\u6b63\u5f0f\u306a\u4ed5\u69d8\u304b\u306f\u4e0d\u660e\uff09<br \/>\n\u3053\u308c\u306f\u6614\u306f\u304b\u306a\u308a\u91cd\u3044\u51e6\u7406\u3060\u3063\u305f\u306e\u3067\u3001\u30b7\u30fc\u30f3\u5207\u308a\u304b\u3048\u6642\u306b\u30b2\u30fc\u30e0\u304c\u79d2\u5358\u4f4d\u3067\u6b62\u307e\u3063\u3066\u3057\u307e\u3044\u300cUI\u3092\u5207\u308a\u66ff\u3048\u308b\u305f\u3073\u306b\u753b\u9762\u304c\u56fa\u307e\u308b\u306e\u3067\u64cd\u4f5c\u6027\u304c\u60aa\u3044\u300d\u306a\u3093\u3066\u3053\u3068\u304c\u8d77\u304d\u3066\u3044\u307e\u3057\u305f\u3002<br \/>\n\u73fe\u5728\u306fUnity\u81ea\u4f53\u306e\u9ad8\u901f\u5316\u3068\u30cf\u30fc\u30c9\u9762\u3067\u306e\u9ad8\u901f\u5316\u3067\u3001\u4eca\u306f\u305d\u3053\u307e\u3067\u91cd\u3044\u51e6\u7406\u306b\u306f\u306a\u3063\u3066\u3044\u306a\u3044\u3088\u3046\u3067\u3059\u3002<\/p>\n<h4>\u4e0d\u4f7f\u7528\u30a2\u30bb\u30c3\u30c8\u306e\u30a2\u30f3\u30ed\u30fc\u30c9\u3000LoadSceneMode.Additive\u306e\u5834\u5408\u306f\u624b\u52d5<\/h4>\n<p>LoadSceneMode.Additive\u306e\u5834\u5408\u306f\u3001SceneManager.UnloadSceneAsync\u3067\u30b7\u30fc\u30f3\u3092\u30a2\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u5834\u5408\u3082\u3001\u4e0d\u4f7f\u7528\u30a2\u30bb\u30c3\u30c8\u306e\u30a2\u30f3\u30ed\u30fc\u30c9\u306f\u884c\u308f\u308c\u307e\u305b\u3093\u3002<br \/>\nResources.UnloadUnusedAssets\u3092\u4f7f\u3063\u3066\u81ea\u529b\u3067\u30a2\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1092.png\" width=700><\/p>\n<p>\u305f\u3060\u3001\u983b\u7e41\u306b\u4f7f\u3046\u306b\u306f\u91cd\u3044\u51e6\u7406\u3060\u3068\u3044\u3046\u306e\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u30b7\u30fc\u30f3\u306e\u30a2\u30f3\u30ed\u30fc\u30c9\u6642\u306f\u4f7f\u308f\u305a\u306b\u5225\u9014\u7ba1\u7406\u3059\u308b\u307b\u3046\u304c\u826f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u30e1\u30e2\u30ea\u306b\u4f59\u88d5\u304c\u3042\u308b\u306a\u3089\u3001\u30ea\u30bd\u30fc\u30b9\u306f\u30a2\u30f3\u30ed\u30fc\u30c9\u3057\u306a\u3044\u307b\u3046\u304c\u6b21\u306b\u4f7f\u3046\u3068\u304d\u306b\u518d\u30ed\u30fc\u30c9\u3059\u308b\u5fc5\u8981\u306a\u304f\u3059\u3050\u4f7f\u3048\u308b\u3068\u3044\u3046\u30e1\u30ea\u30c3\u30c8\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001Resources.UnloadUnusedAssets\u306f\u8907\u6570\u30b7\u30fc\u30f3\u3067\u306e\u30ea\u30bd\u30fc\u30b9\u7ba1\u7406\u306b\u9650\u3063\u305f\u6a5f\u80fd\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u30a2\u30bb\u30c3\u30c8\u30d0\u30f3\u30c9\u30eb\u306a\u3069\u306e\u52d5\u7684\u306b\u30ed\u30fc\u30c9\u3059\u308b\u30ea\u30bd\u30fc\u30b9\u306a\u3069\u306e\u30a2\u30f3\u30ed\u30fc\u30c9\u306a\u3069\u3067\u3082\u7d71\u4e00\u7684\u306b\u4f7f\u308f\u308c\u307e\u3059\u3002<br \/>\nAdditive\u306e\u5834\u5408\u306f\u3001\u305b\u3063\u304b\u304f\u30b7\u30fc\u30f3\u306e\u30a2\u30f3\u30ed\u30fc\u30c9\u3068\u30ea\u30bd\u30fc\u30b9\u306e\u30a2\u30f3\u30ed\u30fc\u30c9\u3092\u5206\u3051\u3066\u4f7f\u3048\u308b\u306e\u3067\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u7279\u6027\u306b\u5408\u308f\u305b\u3066\u6700\u9069\u306a\u3084\u308a\u65b9\u3092\u5b9f\u88c5\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n\u3069\u306e\u7a0b\u5ea6\u306e\u983b\u5ea6\u3067\u3069\u3046\u547c\u3076\u304b\u306f\u5224\u65ad\u304c\u96e3\u3057\u3044\u306e\u3067\u3059\u304c\u3001\u6700\u8fd1\u306eUnity\u3067\u306f\u3001<a href=\"https:\/\/docs.unity3d.com\/ScriptReference\/Application-lowMemory.html\">\u30e1\u30e2\u30ea\u304c\u5c11\u306a\u304f\u306a\u3063\u305f\u6bb5\u968e\u3067\u547c\u3070\u308c\u308b\u30a4\u30d9\u30f3\u30c8<\/a>\u3082\u3042\u308b\u306e\u3067\u3001<strong>\u6700\u4f4e\u9650\u3053\u308c\u3092\u4f7f\u3046\u306e\u304c\u3088\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/strong><\/p>\n<h3>\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u306f<\/h3>\n<p>\u8907\u6570\u30b7\u30fc\u30f3\u3092\u4f7f\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u4e0d\u4f7f\u7528\u30a2\u30bb\u30c3\u30c8\u306e\u30a2\u30f3\u30ed\u30fc\u30c9\u3092\u3057\u305f\u3064\u3082\u308a\u3067\u3001\u5b8c\u5168\u306b\u30a2\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u3066\u3044\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u304c\u8d77\u304d\u304c\u3061\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3068\u3044\u3063\u3066\u300c\u4e0d\u4f7f\u7528\u306e\u3064\u3082\u308a\u304c\u4e0d\u4f7f\u7528\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u3044\u3064\u307e\u3067\u305f\u3063\u3066\u3082\u6d88\u3048\u306a\u3044\u300d\u3068\u3044\u3046\u72b6\u614b\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u306e\u304c\u539f\u56e0\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1093.png\" width=700><\/p>\n<h3>\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u308b\u539f\u56e0\u306f\u53c2\u7167\u304c\u6b8b\u3063\u3066\u3044\u308b\u304b\u3089<\/h3>\n<p>\u8907\u6570\u30b7\u30fc\u30f3\u306b\u9650\u3063\u305f\u8a71\u3067\u306f\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u4e00\u8a00\u3067\u3044\u3046\u3068\u300c\u30b7\u30fc\u30f3\u5185\u306b\u6b8b\u3063\u3066\u3044\u308b\u3082\u306e\u304b\u3089\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u306f\u6d88\u3048\u306a\u3044\u300d\u3068\u3044\u3046\u306e\u304c\u57fa\u672c\u3067\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u30c6\u30af\u30b9\u30c1\u30e3\u3092\u53c2\u7167\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8A\u3068\u3001\u305d\u308c\u3092\u53c2\u7167\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8B\u304c\u3042\u3063\u305f\u5834\u5408<\/p>\n<pre><code class=\"language-csharp\">\npublic class SampleA : MonoBehaviour\n{\n    \/\/\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u30fc\u4e0a\u3067\u30c6\u30af\u30b9\u30c1\u30e3\u3092\u53c2\u7167\u3057\u3066\u3044\u308b\n    public Texture texture;\n}\n\npublic class SampleB : MonoBehaviour\n{\n    \/\/\u30a4\u30f3\u30b9\u30da\u30af\u30bf\u30fc\u4e0a\u3067A\u3092\u53c2\u7167\u3057\u3066\u3044\u308b\n    public SampleA sampleA;\n}\n<\/code><\/pre>\n<p>A\u3092\u524a\u9664\uff08Destroy\uff09\u3057\u3066\u3082\u3001B\u306b\u53c2\u7167\u304c\u6b8b\u3063\u3066\u3044\u308b\u9650\u308a\u306f\u3001A\u306f\u6d88\u3048\u305a\u30c6\u30af\u30b9\u30c1\u30e3\u3078\u306e\u53c2\u7167\u3082\u6b8b\u308b\u305f\u3081\u3001\u4e0d\u4f7f\u7528\u72b6\u614b\u306b\u306a\u3089\u306a\u3044\u305f\u3081Resources.UnloadUnusedAssets\u306e\u5bfe\u8c61\u306b\u306a\u308a\u307e\u305b\u3093\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1095.png\" width=700><\/p>\n<h4>null\u3060\u3051\u3069null\u3058\u3083\u306a\u3044\u554f\u984c<\/h4>\n<p>Unity\u3067\u306fGameObject\u3084\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u524a\u9664\u3059\u308b\u3068\u304d\u306fDestroy\u3092\u4f7f\u3044\u307e\u3059\u3002<br \/>\n\u3067\u3059\u304c\u3001\u3053\u306eDestroy\u3067\u30d2\u30a8\u30e9\u30eb\u30ad\u30fc\u4e0a\u304b\u3089\u306f\u6d88\u3048\u308b\u306e\u3067\u3059\u304c\u3001\u3069\u3053\u304b\u306b\u53c2\u7167\u304c\u6b8b\u3063\u3066\u3044\u308b\u9650\u308a\u306f\u672c\u5f53\u306e\u610f\u5473\u3067\u306f\u6d88\u3048\u307e\u305b\u3093\u3002<br \/>\n\u305d\u3057\u3066\u3001\u3053\u306e\u72b6\u614b\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306fnull\u3068\u3057\u3066\u5224\u5b9a\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306f\u3001<a href=\"https:\/\/blogs.unity3d.com\/2014\/05\/16\/custom-operator-should-we-keep-it\/\">Unity\u306eObject\u304c==\u6f14\u7b97\u5b50\u3092override\u3057\u3066\u3044\u308b<\/a>\u304b\u3089\u8d77\u304d\u307e\u3059\u3002<br \/>\n\u4e00\u90e8\u3067\u306f\u7d50\u69cb\u6709\u540d\u306a\u8a71\u3067\u3059\u3002<\/p>\n<p>\u57fa\u672c\u7684\u306b\u306f\u3001Destroy\u3057\u305f\u3082\u306e\u3078\u306e\u53c2\u7167\u3092\u6301\u3064\u3088\u3046\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u3059\u308b\u3053\u3068\u306f\u3042\u307e\u308a\u306a\u3044\u3067\u3059\u3057\u3001<br \/>\n\u4eee\u306b\u3042\u3063\u305f\u3068\u3057\u3066\u3082\u3001\u4f7f\u304a\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u3067\u308b\u306e\u3067\u5927\u62b5\u306f\u81ea\u7136\u3068\u76f4\u3057\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n<img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1096.png\" alt=\"\" \/><\/p>\n<p>\u305f\u3060\u3001null\u30c1\u30a7\u30c3\u30af\u3092\u3057\u3066\u3057\u307e\u3063\u305f\u305f\u3081\u306b\u304b\u3048\u3063\u3066\u554f\u984c\u306b\u6c17\u3065\u304d\u3065\u3089\u304f\u306a\u308b\u3068\u3044\u3046\u843d\u3068\u3057\u7a74\u306f\u3042\u308a\u3048\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-csharp\">public class SampleB : MonoBehaviour\n{\n    \/\/A\u3092\u53c2\u7167\u3057\u3066\u3044\u308b\n    public SampleA sampleA;\n\n    private void Update()\n    {\n        \/\/Destroy\u3055\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\n        \/\/\u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u3067\u308b\n        Debug.Log(sampleA.name);\n\n        if (sampleA != null)\n        {\n            \/\/null\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u308b\u3068\u3001\u554f\u984c\u306b\u6c17\u3065\u304d\u3065\u3089\u3044\u3053\u3068\u306f\u3042\u308a\u3046\u308b\n            Debug.Log(sampleA.name);\n        }\n    }\n}<\/code><\/pre>\n<h4>\u53c2\u7167\u6d88\u305b\u3070\u3001\u30ea\u30fc\u30af\u306f\u89e3\u6d88\u3059\u308b<\/h4>\n<p>\u30ea\u30fc\u30af\u3092\u89e3\u6d88\u3059\u308b\u306b\u306f\u3001null\u3092\u4ee3\u5165\u3057\u3066\u53c2\u7167\u3092\u6d88\u3059\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-csharp\">public class SampleB : MonoBehaviour\n{\n    \/\/A\u3092\u53c2\u7167\u3057\u3066\u3044\u308b\n    public SampleA sampleA;\n\n    public void DestroySampleA()\n    {\n        Destroy(sampleA.gameObject);\n\u3000\u3000\u3000\u3000\/\/null\u3092\u4ee3\u5165\u3059\u308b\u3053\u3068\u3067\u53c2\u7167\u306f\u6d88\u3048\u308b\n        sampleA = null;\n    }\n}<\/code><\/pre>\n<h4>\u53c2\u7167\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u6b7b\u306d\u308b\u3002\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u6b7b\u306d\u306a\u3044<\/h4>\n<p>\u6df7\u4e71\u3057\u304c\u3061\u3067\u3059\u304c\u3001\u53c2\u7167\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u300c\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u300d\u5834\u5408\u306b\u30ea\u30fc\u30af\u304c\u8d77\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-csharp\">\npublic class SampleA : MonoBehaviour\n{\n    \/\/\u30c6\u30af\u30b9\u30c1\u30e3\u3092\u53c2\u7167\u3057\u3066\u3044\u308b\n    public Texture texture;\n\n    \/\/B\u3092\u53c2\u7167\u3057\u3066\u3044\u308b\n    public SampleB sampleB;\n}\n\npublic class SampleB : MonoBehaviour\n{\n    \/\/A\u3092\u53c2\u7167\u3057\u3066\u306f\u3044\u306a\u3044\n}<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1097.png\" width=500><\/p>\n<h3>\u6d88\u3048\u308b\u304b\u6d88\u3048\u306a\u3044\u304b\u306f\u3001\u6839\u672c\u304b\u3089\u53c2\u7167\u304c\u8fbf\u308c\u308b\u304b\u3069\u3046\u304b<\/h3>\n<p>\u30e1\u30e2\u30ea\u3092\u89e3\u653e\u3059\u308bGC\uff08\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\uff09\u306e\u4ed5\u7d44\u307f\u306f\u3001\u300c\u6839\u672c\u304b\u3089\u53c2\u7167\u3092\u305f\u3069\u308c\u308b\u304b\uff1f\u300d\u3067\u5224\u65ad\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3053\u306e\u6839\u672c\u3068\u3044\u3046\u306e\u306f\uff08Unity\u5185\u90e8\u306a\u306e\u3067\u8a73\u7d30\u306f\u4e0d\u660e\u3067\u3059\u304c\uff09\u3001\u57fa\u672c\u7684\u306b\u306f\u30b7\u30fc\u30f3\u4e0a\u306b\u3042\u308b\u304b\u3069\u3046\u304b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u76f8\u4e92\u306b\u53c2\u7167\u3057\u3066\u3044\u308b\u3060\u3051\u306e\u3082\u306e\u3067\u308c\u3070\u3001\u53c2\u7167\u304c\u6b8b\u3063\u3066\u3044\u3066\u3082\u4e21\u65b9\u3068\u3082Destroy\u3059\u308c\u3070\u6d88\u3048\u307e\u3059\u3002<br \/>\n\u30b7\u30fc\u30f3\u5185\u304b\u3089\u53c2\u7167\u3092\u8fbf\u308c\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1101.png\" width=500><\/p>\n<p>\u3044\u3063\u307d\u3046\u3001\u30b7\u30fc\u30f3\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u3082\u306e\u304b\u3089\u9593\u63a5\u7684\u306b\u3067\u3082\u53c2\u7167\u3092\u8fbf\u308c\u308b\u306a\u3089\u307e\u3060GC\u306e\u5bfe\u8c61\u306b\u306a\u3089\u305a\u5b58\u5728\u3057\u7d9a\u3051\u307e\u3059\u3002<br \/>\n\u300c\u30c6\u30af\u30b9\u30c1\u30e3\u3092\u53c2\u7167\u3059\u308bA\u300d\u2190\u300c\u3092\u53c2\u7167\u3059\u308bB\u300d\u2190\u300c\u3092\u53c2\u7167\u3059\u308bC\u300d<br \/>\n\u306a\u3069\u304c\u3042\u3063\u305f\u5834\u5408\u3001C\u304c\u751f\u304d\u3066\u3044\u3066\u53c2\u7167\u304c\u6d88\u3048\u306a\u3044\u9650\u308a\u306f\u3001\u5b58\u5728\u3057\u7d9a\u3051\u307e\u3059\u3002<br \/>\n\u9577\u304f\u7d9a\u304f\u30b7\u30fc\u30f3\u306e\u4e2d\u3067\u983b\u7e41\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092Destroy\u3057\u305f\u308a\u751f\u6210\u3057\u305f\u308a\u3059\u308b\u5834\u5408\u306f\u3001Destroy\u3057\u305f\u3082\u306e\u3078\u306e\u53c2\u7167\u304c\u6b8b\u3089\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>\u8907\u6570\u30b7\u30fc\u30f3\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u3084\u3059\u3044\u7406\u7531\u306f\u4e38\u3054\u3068\u6d88\u305b\u306a\u3044\u304b\u3089<\/h3>\n<p>\u3069\u3093\u306a\u306b\u69cb\u6210\u304c\u8907\u96d1\u3067\u3042\u3063\u305f\u3068\u3057\u3066\u3082\u30b7\u30fc\u30f3\u4e38\u3054\u3068\u6d88\u3057\u3066\u3057\u307e\u3048\u3070\u5168\u90e8\u6d88\u3048\u308b\u306e\u3067\u3001\u30b7\u30fc\u30f3\u3092\u30a2\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u524d\u63d0\u306e\u69cb\u6210\u3067\u3042\u308c\u3070\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306f\u3042\u307e\u308a\u6c17\u3057\u306a\u304f\u3066\u3082\u8d77\u304d\u3065\u3089\u3044\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1102.png\" width=500><\/p>\n<p>\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u3082\u30b2\u30fc\u30e0\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u7684\u306a\u3082\u306e\u306e\u305f\u3081\u306bSingleton\u3084ScriptableObject\u306e\u3088\u3046\u306a\u300c\u6d88\u3048\u306a\u3044\u300d\u3068\u3053\u308d\u306b\u53c2\u7167\u3092\u6b8b\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u308c\u304c\u539f\u56e0\u3067\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u304c\u8d77\u304d\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u306f\u305d\u3046\u3044\u3063\u305f\u90e8\u5206\u306b\u53c2\u7167\u3092\u3082\u305f\u305b\u308b\u5834\u5408\u3001\u57fa\u672c\u306b\u5fe0\u5b9f\u306b\u300c\u5e38\u306b\u4f7f\u3044\u7d42\u308f\u3063\u305f\u3089\u5f8c\u7247\u4ed8\u3051\u3092\u3057\u3066\u6d88\u3057\u3066\u304a\u304f\u300d\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1103.png\" width=500><\/p>\n<h3>\u8907\u6570\u30b7\u30fc\u30f3\u3067\u8d77\u304d\u304c\u3061\u306a\u554f\u984c<\/h3>\n<p>\u4ee5\u4e0b\u3001\u8907\u6570\u30b7\u30fc\u30f3\u3067\u8d77\u304d\u304c\u3061\u306a\u554f\u984c\u3092\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n<h4>\u30a4\u30d9\u30f3\u30c8\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u306b\u306f\u6ce8\u610f<\/h4>\n<p>\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u81ea\u4f53\u3078\u306e\u53c2\u7167\u3067\u306a\u304f\u3066\u3082\u3001Action\u3084\u30a4\u30d9\u30f3\u30c8\u306a\u3069\u306b\u30e1\u30bd\u30c3\u30c9\u3084\u30c7\u30ea\u30b2\u30fc\u30c9\u3092\u767b\u9332\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u305d\u308c\u306f\u5143\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3078\u306e\u53c2\u7167\u6271\u3044\u306b\u306a\u308b\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u7684\u306a\u51e6\u7406\u3092\u3059\u308b\u305f\u3081\u306b\u30b2\u30fc\u30e0\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306a\u3069\u30b7\u30fc\u30f3\u5916\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u30a4\u30d9\u30f3\u30c8\u3092\u767b\u9332\u3057\u3066\u3044\u308b\u5834\u5408\u3001<br \/>\n\u4f7f\u3044\u7d42\u308f\u3063\u305f\u3089-=\u306a\u3069\u3057\u3066\u3061\u3083\u3093\u3068\u524a\u9664\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-csharp\">\npublic class GameManager : SingletonMonoBehaviour&lt;GameManager&gt;\n{\n\u3000\u3000\/\/\u30b2\u30fc\u30e0\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089\u30a4\u30d9\u30f3\u30c8\u3092\u901a\u77e5\u3059\u308b\n    public event Action OnNewEvent;\n}\n\npublic class SampleScene : MonoBehaviour\n{\n    void OnEnable()\n    {\n        GameManager.Instance.OnNewEvent += NewEvent;\n    }\n\n    void OnDisable()\n    {\n        GameManager.Instance.OnNewEvent -= NewEvent;\n    }\n\n    \/\/\u30b2\u30fc\u30e0\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089\u30a4\u30d9\u30f3\u30c8\u304c\u547c\u3070\u308c\u305f\u6642\u306e\u51e6\u7406\n    void NewEvent()\n    {\n    }\n}\n<\/code><\/pre>\n<h4>OnDestroy\u306f\u4e00\u5ea6\u3082\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u3068\u547c\u3070\u308c\u306a\u3044<\/h4>\n<p>\u305f\u3060\u3057\u3001\u300c\u4f7f\u3044\u7d42\u308f\u3063\u305f\u3089\u300d\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3092OnDestroy\u306a\u3069\u3067\u3068\u3063\u3066\u3044\u308b\u5834\u5408\u3001\u300c\u4e00\u5ea6\u3082\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u5834\u5408OnDestroy\u306f\u547c\u3070\u308c\u306a\u3044\u300d\u3068\u3044\u3046Unity\u306e\u843d\u3068\u3057\u7a74\u3082\u3042\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\nUI\u7528\u306e\u30b7\u30fc\u30f3\u306a\u3069\u3067\u300c\u30ed\u30fc\u30c9\u76f4\u5f8c\u306f\u975e\u8868\u793a\u306b\u3059\u308b\u305f\u3081\u6700\u521d\u304b\u3089\u975e\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u3057\u3066\u304a\u304f\u300d\u300c\u30b2\u30fc\u30e0\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u306b\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u767b\u9332\u3057\u3066\u304a\u3044\u3066\u3001\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u3067\u8868\u793a\u300d\u3001\u306a\u3093\u3066\u4f7f\u3044\u65b9\u3092\u3057\u3066\u3044\u308b\u3068\u898b\u4e8b\u306b\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u306f\u307e\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-csharp\">    \/\/\u5916\u90e8\u304b\u3089\u4efb\u610f\u306e\u30bf\u30a4\u30df\u30b0\u3067\u521d\u671f\u5316\u3000\n    public void Init()\n    {\n        GameManager.Instance.OnUiOpen += Open\n    }\n\n    \/\/OnDestroy\u304c\u547c\u3070\u308c\u308b\u3068\u306f\u9650\u3089\u306a\u3044\n    void OnDestroy()\n    {\n        GameManager.Instance.OnUiOpen -= Open\n    }\n\n    \/\/\u30b2\u30fc\u30e0\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u304b\u3089UI\u3092\u958b\u304f\u30a4\u30d9\u30f3\u30c8\u3092\u53d7\u3051\u53d6\u308b\n    void Open()\n    {\n        this.gameObject.SetActive(true);\u3000\u3000\u3000\u3000\n    }<\/code><\/pre>\n<h4>\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u3092\u4f7f\u3046\u3068\u304d\u306b\u6c17\u3092\u3064\u3051\u308b\u3053\u3068<\/h4>\n<p>\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u3084static\u306e\u5834\u5408\u306f\u3001\u30b7\u30fc\u30f3\u5185\u304b\u3089\u53c2\u7167\u304c\u8fbf\u308c\u308b\u304b\u306b\u95a2\u4fc2\u306a\u304f\u3001static\u306a\u90e8\u5206\u306b\u53c2\u7167\u304c\u6b8b\u3063\u3066\u3044\u308b\u9650\u308a\u306f\u6d88\u3048\u306a\u3044\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n\u305f\u3068\u3048\u3070\u3001\u4eee\u306b\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u3092\u6d88\u3057\u305f\u3068\u3057\u3066\u3082\u3001\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u30d1\u30bf\u30fc\u30f3\u306estatic\u306a\u90e8\u5206\u306b\u53c2\u7167\u304c\u6b8b\u3063\u3066\u3044\u308b\u5834\u5408\u306f\u305d\u3053\u304b\u3089\u306e\u53c2\u7167\u306f\u6d88\u3048\u307e\u305b\u3093\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u306f\u4e00\u5ea6\u4f5c\u3063\u305f\u3089\u6d88\u3055\u306a\u3044\u524d\u63d0\u306e\u4f7f\u3044\u65b9\u3092\u3059\u308b\u3068\u306f\u601d\u3046\u306e\u3067\u3001\u3042\u307e\u308a\u554f\u984c\u306b\u306a\u308b\u3053\u3068\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001<br \/>\n\u4eee\u306b\u6d88\u3059\u5834\u5408\u306fOnDestroy\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306bnull\u3092\u8a2d\u5b9a\u3059\u308b\u306a\u3069\u3057\u3066static\u306a\u53c2\u7167\u3092\u3061\u3083\u3093\u3068\u89e3\u653e\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-csharp\">    protected virtual void OnDestroy()\n    {\n        if (instance == this)\n        {\n            instance = null;\n        }\n    }<\/code><\/pre>\n<h4>ScriptableObject\u3092\u4f7f\u3046\u3068\u8d77\u304d\u304c\u3061\u306a\u30df\u30b9<\/h4>\n<p>ScriptableObject\u306b\u30ed\u30b8\u30c3\u30af\u3092\u6301\u305f\u305b\u308b\u5834\u5408\u3001\u57fa\u672c\u7684\u306b\u306f\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u306e\u3088\u3046\u306a\u4f7f\u3044\u65b9\u3068\u3042\u307e\u308a\u5909\u308f\u3089\u306a\u3044\u3067\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001ScirptableObject\u81ea\u8eab\u306b\u306fOnDestroy\u306e\u3088\u3046\u306a\u30b7\u30fc\u30f3\u5185\u304b\u3089\u524a\u9664\u3055\u308c\u305f\u3068\u304d\u306b\u547c\u3070\u308c\u308b\u51e6\u7406\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u57fa\u672c\u7684\u306b\u306f\u5404\u30b7\u30fc\u30f3\u5185\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u307b\u3046\u304c\u81ea\u8eab\u304c\u767b\u9332\u3057\u305f\u53c2\u7167\u306e\u89e3\u653e\u3092\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4e00\u5fdc\u3001\u53c2\u7167\u304c\u306a\u304f\u306a\u304f\u306a\u3063\u3066\u30a2\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3068\u304d\u306bOnDisable\u304c\u547c\u3070\u308c\u308b\u306e\u3067\u3059\u304c\u3001\u5fc5\u8981\u306a\u306e\u306f\u305d\u306e\u524d\u6bb5\u968e\u306a\u306e\u3067\u610f\u5473\u304c\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u307e\u305f\u30a8\u30c7\u30a3\u30bf\u4e0a\u304b\u3089\u3082\u53c2\u7167\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3001\u30b7\u30fc\u30f3\u5185\u304b\u3089\u53c2\u7167\u304c\u306a\u304f\u306a\u3063\u3066\u3082\u30a2\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u306a\u3044\u3068\u3044\u3046\u7279\u6027\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4e0b\u624b\u306bOnDisable\u3092\u4f7f\u3046\u3068\u3001\u30a8\u30c7\u30a3\u30bf\u4e0a\u3068\u5b9f\u6a5f\u4e0a\u3067\u9055\u3046\u52d5\u4f5c\u3092\u3057\u304b\u306d\u306a\u304f\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3053\u306e\u8fba\u306e\u30a4\u30d9\u30f3\u30c8\u95a2\u6570\u3092\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3068\u540c\u3058\u3088\u3046\u306a\u3064\u3082\u308a\u3067\u4f7f\u3046\u3053\u3068\u306f\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u305d\u306e\u70b9\u306f\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u57fa\u672c\u7684\u306a\u30eb\u30fc\u30eb\u3092\u6c7a\u3081\u308b\u307b\u3046\u304c\u826f\u3044<\/h3>\n<p>\u305f\u3068\u3048\u3070<br \/>\n\u30fb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u306f\u30b2\u30fc\u30e0\u8d77\u52d5\u5f8c\u5e38\u306b\u5b58\u5728\u3055\u305b\u6d88\u3055\u306a\u3044\u3002<br \/>\n\u30fb\u5404\u30b7\u30fc\u30f3\u3067\u306f\u3001\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u4ee5\u5916\u306e\u307b\u304b\u306e\u30b7\u30fc\u30f3\u3078\u306e\u53c2\u7167\u306f\u6975\u529b\u6b8b\u3055\u306a\u3044\u3002\u53c2\u7167\u3092\u6301\u3063\u305f\u3089\u5f8c\u59cb\u672b\u3092\u3057\u3063\u304b\u308a\u3059\u308b\u3002<br \/>\n\u30fb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u304b\u3089\u5404\u30b7\u30fc\u30f3\u3078\u306e\u53c2\u7167\u306f\u6975\u529b\u3057\u306a\u3044\u3002<br \/>\n\u30fb\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30b7\u30fc\u30f3\u306b\u5404\u30b7\u30fc\u30f3\u306e\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3092\u767b\u9332\u3057\u305f\u5834\u5408\u3001\u767b\u9332\u3057\u305f\u5404\u30b7\u30fc\u30f3\u304c\u5404\u81ea\u3067\u5f8c\u59cb\u672b\u3092\u3059\u308b\u3002<br \/>\n\u3068\u3044\u3063\u305f\u611f\u3058\u3067\u3059\u3002<br \/>\n\u305f\u3060\u3057\u3001\u53c2\u7167\u3092\u6b8b\u3055\u306a\u3044\u3053\u3068\u306b\u3053\u3060\u308f\u308a\u3059\u304e\u308b\u3068\u3001\u6bce\u56de\u691c\u7d22\u3057\u305f\u308aGetComponent\u305b\u3056\u308b\u3092\u3048\u306a\u304f\u306a\u308b\u306e\u3067\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u7684\u306b\u306f\u3088\u304f\u306a\u3044\u3067\u3059\u306e\u3067\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u73fe\u5b9f\u7684\u306b\u306f\u3001\u4eee\u306b\u30ea\u30fc\u30af\u3057\u3066\u3044\u305f\u3068\u3057\u3066\u3082\u3001\u30ea\u30fc\u30af\u3057\u3066\u3044\u308b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u76f4\u63a5\u307e\u305f\u306f\u9593\u63a5\u7684\u306b\u30a2\u30bb\u30c3\u30c8\u306e\u53c2\u7167\u3092\u6301\u3063\u3066\u3044\u306a\u3044\u9650\u308a\u306f\u30a2\u30bb\u30c3\u30c8\u304c\u30a2\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u30ea\u30bd\u30fc\u30b9\u4ee5\u5916\u306f\u30e1\u30e2\u30ea\u30b5\u30a4\u30ba\u306f\u9650\u3089\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u88ab\u5bb3\u304c\u307b\u3068\u3093\u3069\u306a\u3044\u3053\u3068\u3082\u591a\u3044\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/madnesslabo.net\/utage\/wp-content\/uploads\/2020\/06\/ss_1104.png\" width=500><\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u307e\u3059\u304c\u3001\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u3078\u306e\u5bfe\u51e6\u306f\u96e3\u3057\u3044\u3046\u3048\u306b\u3001\u5272\u308a\u5207\u3063\u3066\u3057\u307e\u3063\u3066\u3082\u554f\u984c\u306a\u3044\u3068\u304d\u306f\u554f\u984c\u306a\u3044\u306e\u3067\u3001\u672c\u5f53\u306b\u52b4\u529b\u3092\u5272\u304f\u3079\u304d\u304b\u306f\u5404\u81ea\u3067\u5224\u65ad\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3053\u3053\u306b\u66f8\u3044\u3066\u3042\u308b\u3053\u3068\u3082\u3001\u79c1\u304c\u305d\u306e\u3088\u3046\u306b\u89e3\u91c8\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3001\u672c\u5f53\u306b\u305d\u3046\u3060\u3068\u3044\u3046\u4fdd\u8a3c\u306f\u3069\u3053\u306b\u3082\u306a\u3044\u306e\u3067\u3001\u6700\u7d42\u7684\u306b\u306f\u81ea\u5206\u3067\u691c\u8a3c\u3057\u3066\u8a66\u884c\u932f\u8aa4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30e1\u30e2\u30ea\u7ba1\u7406\u306e\u53c2\u8003\u8cc7\u6599<\/h3>\n<p>\u30e1\u30e2\u30ea\u7ba1\u7406\u306f\u6280\u8853\u7684\u306b\u96e3\u3057\u3044\u306e\u3067\u3001\u4e2d\u5805\u4ee5\u4e0a\u306e\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u3058\u3083\u306a\u3044\u3068\u628a\u63e1\u306f\u96e3\u3057\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u4ee5\u4e0b\u3001\u53c2\u8003\u8cc7\u6599\u3092\u5217\u6319\u3057\u3066\u304a\u304d\u307e\u3059\u3002<br \/>\nUnity\u516c\u5f0f\u304b\u3089\u306e\u60c5\u5831<br \/>\n<a href=\"https:\/\/docs.unity3d.com\/ja\/current\/Manual\/BestPracticeUnderstandingPerformanceInUnity2.html\">Unity\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3000\u30d9\u30b9\u30c8 \u30d7\u30e9\u30af\u30c6\u30a3\u30b9 \u30ac\u30a4\u30c9\u3000Unity \u306b\u304a\u3051\u308b\u6700\u9069\u5316\u3000\u30e1\u30e2\u30ea<\/a><br \/>\n<a href=\"https:\/\/docs.unity3d.com\/ja\/current\/Manual\/BestPracticeUnderstandingPerformanceInUnity4-1.html\">Unity\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3000\u30d9\u30b9\u30c8 \u30d7\u30e9\u30af\u30c6\u30a3\u30b9 \u30ac\u30a4\u30c9\u3000Unity \u306b\u304a\u3051\u308b\u6700\u9069\u5316\u3000\u30de\u30cd\u30fc\u30b8\u30d2\u30fc\u30d7<\/a><br \/>\n<a href=\"https:\/\/www.slideshare.net\/UnityTechnologiesJapan\/unity-111054310\">\u3010CEDEC2018\u3011\u4e00\u6b69\u5148\u306eUnity\u3067\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\/\u30e1\u30e2\u30ea\u8a08\u6e2c\u3001\u30c7\u30d0\u30c3\u30b0\u8853<\/a><br \/>\n\u30e1\u30e2\u30ea\u30ea\u30fc\u30af\u306b\u95a2\u3057\u3066\u306f\u3053\u3061\u3089\u304c\u8a73\u3057\u3044\u3067\u3059\u3002<br \/>\n<a href=\"https:\/\/speakerdeck.com\/cygames\/unityniokerumemoriguan-li-1\">Unity\u306b\u304a\u3051\u308b\u30e1\u30e2\u30ea\u7ba1\u7406<\/a><\/p>\n<h2>\u3055\u3044\u3054\u306b<\/h2>\n<p>\u3053\u3053\u3067\u307e\u3068\u3081\u305f\u3082\u306e\u306f\u3001\u3069\u3061\u3089\u304b\u3068\u3044\u3046\u3068\u6982\u8981\u306e\u8aac\u660e\u306a\u306e\u3067\u3001\u5b9f\u969b\u306b\u4f7f\u3046\u306b\u306f\u5404\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8a2d\u8a08\u306b\u5408\u308f\u305b\u3066\u81ea\u529b\u3067\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u3057\u3066\u3044\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u5b9f\u969b\u306b\u306f\u3001\u4e0a\u8a18\u306e\u5404\u6a5f\u80fd\u306f\u3069\u308c\u304b\u3092\u4f7f\u3046\u304b\u4e00\u3064\u6c7a\u3081\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5834\u5408\u306b\u3088\u3063\u3066\u306f\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046\u3053\u3068\u304c\u591a\u304f\u306a\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u300c\u57fa\u672c\u7684\u306b\u306fAdditive\u3092\u4f7f\u3044\u3001\u30bf\u30a4\u30c8\u30eb\u306a\u3069\u306e\u8d77\u52d5\u30b7\u30fc\u30f3\u306b\u623b\u308b\u3068\u304d\u3060\u3051Single\u30ed\u30fc\u30c9\u3059\u308b\u300d\u306a\u3069\u3068\u3044\u3063\u305f\u4f7f\u3044\u65b9\u3082\u8003\u3048\u3089\u308c\u307e\u3059\u3057<br \/>\n\u300cDontDestroyOnLoad\u3068\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3\u3068ScriptableObject\u3068SceneManger\u5168\u90e8\u4f7f\u3046\u300d\u3068\u3044\u3046\u3053\u3068\u3082\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u30a2\u30bb\u30c3\u30c8\u30b9\u30c8\u30a2\u306e\u30a2\u30bb\u30c3\u30c8\u306fDontDestroyOnLoad\u3092\u4f7f\u3063\u3066\u3044\u308b\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\u305f\u3068\u3048\u3070DoTween\u306a\u3069\u304c\u305d\u3046\u3067\u3059\u3002<br \/>\n\u30a2\u30bb\u30c3\u30c8\u958b\u767a\u8005\u3068\u3057\u3066\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u52a0\u7b97\u30b7\u30fc\u30f3\u3092\u4f7f\u3046\u304b\u3069\u3046\u304b\u308f\u304b\u3089\u306a\u3044\u305f\u3081\u3001\u305d\u3046\u305b\u3056\u308b\u3092\u5f97\u306a\u3044\u306e\u3060\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u305d\u308c\u305e\u308c\u306e\u7279\u5fb4\u3092\u628a\u63e1\u3057\u3066\u81ea\u5206\u306a\u308a\u306b\u6700\u9069\u306a\u4f7f\u3044\u65b9\u3092\u3057\u3066\u3044\u305f\u3060\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u307b\u304b\u306b\u3001Unity\u306b\u306fNaviMesh\u3084\u30e9\u30a4\u30c8\u30de\u30c3\u30d7\u306a\u3069\u30b7\u30fc\u30f3\u306b\u5f37\u304f\u4f9d\u5b58\u3057\u305f\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u306e\u70b9\u3092\u8e0f\u307e\u3048\u3066\u8907\u6570\u30b7\u30fc\u30f3\u3092\u3069\u3046\u7de8\u96c6\u3057\u3069\u3046\u5b9f\u88c5\u3059\u308b\u304b\u306b\u95a2\u3057\u3066\u306f\uff08\u3084\u3063\u305f\u3053\u3068\u304c\u306a\u3044\u306e\u3067\uff09\u79c1\u3082\u308f\u304b\u308a\u307e\u305b\u3093\u3002<br \/>\n<a href=\"https:\/\/docs.unity3d.com\/ja\/current\/Manual\/MultiSceneEditing.html\">Unity\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30de\u30eb\u30c1\u30b7\u30fc\u30f3\u7de8\u96c6<\/a>\u306b\u306f\u305d\u306e\u70b9\u306e\u6ce8\u610f\u70b9\u304c\u8f09\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4eca\u56de\u307e\u3068\u3081\u305f\u3053\u3068\u306f\u3059\u3079\u3066\u3001\u3042\u304f\u307e\u3067\u500b\u4eba\u7684\u306b\u77e5\u308b\u9650\u308a\u3092\u307e\u3068\u3081\u305f\u3060\u3051\u3067\u3059\u306e\u3067\u3001\u9593\u9055\u3063\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3057\u3001\u30d0\u30c3\u30c9\u30ce\u30a6\u30cf\u30a6\u3068\u307f\u306a\u3055\u308c\u308b\u3082\u306e\u3082\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u3042\u305f\u304b\u3082Unity\u306e\u4ed5\u69d8\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3057\u307e\u3063\u3066\u3044\u308b\u90e8\u5206\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u7d4c\u9a13\u4e0a\u305d\u3046\u306a\u308b\u304b\u3089\u66f8\u3044\u3066\u308b\u3060\u3051\u306e\u3068\u3053\u308d\u3082\u591a\u3044\u3067\u3059\u3002<br \/>\n\u672c\u5f53\u306b\u4ed5\u69d8\u306a\u306e\u304b\u306f\u308f\u304b\u308a\u307e\u305b\u3093\u3057\u3001Unity\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306b\u3088\u3063\u3066\u306f\u4ed5\u69d8\u304c\u9055\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f\u3044\u3064\u304bUnity\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u6574\u3046\u3053\u3068\u3092\u7948\u308a\u307e\u3059\u3002<\/p>\n<h3>\u30b7\u30fc\u30f3\u95a2\u4fc2\u306e\u53c2\u8003<\/h3>\n<p>\u4e0a\u8a18\u3067\u4e0a\u3052\u305f\u3053\u3068\u306f\u3001\u5b9f\u88c5\u65b9\u6cd5\u3068\u3057\u3066\u306f\u5177\u4f53\u6027\u306b\u6b20\u3051\u308b\u9762\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\nUnity\u306e\u30b7\u30fc\u30f3\u95a2\u4fc2\u306e\u60c5\u5831\u306f\u30cd\u30c3\u30c8\u4e0a\u306b\u307b\u304b\u306b\u3082\u305f\u304f\u3055\u3093\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u3061\u3089\u3082\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n<a href=\"https:\/\/qiita.com\/lycoris102\/items\/bf0a9ec4a653b4dd97b9\">[Unity\u521d\u5fc3\u8005Tips]\u753b\u9762\u3092\u5207\u308a\u66ff\u3048\u308b3\u3064\u306e\u65b9\u6cd5\u3001\u305d\u3057\u3066SceneManager.LoadSceneAsync\u306a\u3069<\/a><br \/>\n<a href=\"https:\/\/qiita.com\/lycoris102\/items\/bf0a9ec4a653b4dd97b9\">[Unity] Scene\u306e\u5f79\u5272\u3084\u4f7f\u3044\u65b9\u3092\u3056\u3063\u304f\u308a\u307e\u3068\u3081\u305f<\/a><br \/>\n<a href=\"http:\/\/tsubakit1.hateblo.jp\/entry\/2015\/11\/07\/024350\">\u30b7\u30fc\u30f3\u9593\u3067\u30b9\u30b3\u30a2\u3092\u5171\u6709\u3000\u307e\u3068\u3081<\/a><br \/>\n<a href=\"https:\/\/kan-kikuchi.hatenablog.com\/entry\/ManagerSceneAutoLoader\">\u5168\u3066\u306e\u30b7\u30fc\u30f3\u306b\u5b58\u5728\u3057\u3001\u304b\u3064\u3001\u4e00\u3064\u3057\u304b\u5b58\u5728\u3057\u3066\u306f\u3044\u3051\u306a\u3044\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u7684\u5b58\u5728\u306e\u5b9f\u88c5\u65b9\u6cd5<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8907\u6570\u30b7\u30fc\u30f3\u5b9f\u88c5\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u305f\u80cc\u666f \u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u306a\u3044 Unity\u3067\u306f\u3001\u30b7\u30fc\u30f3\u3092\u7de8\u96c6\u3057\u3066\u30b2\u30fc\u30e0\u3092\u4f5c\u3063\u3066\u3044\u304f\u306e\u304c\u57fa\u672c\u3067\u3059\u3002 \u30b7\u30fc\u30f3\u306f\u4e00\u3064\u3067\u306f\u306a\u304f\u8907\u6570\u4f7f\u3063\u3066\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u8a73\u3057\u3044\u3084\u308a\u65b9\u306b\u95a2\u3057\u3066\u306fUnit [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":5636,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"_lmt_disableupdate":"no","_lmt_disable":"no","jetpack_post_was_ever_published":false,"footnotes":""},"aioseo_notices":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/P58j32-2Tb","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=\/wp\/v2\/pages\/11109"}],"collection":[{"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11109"}],"version-history":[{"count":271,"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=\/wp\/v2\/pages\/11109\/revisions"}],"predecessor-version":[{"id":15217,"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=\/wp\/v2\/pages\/11109\/revisions\/15217"}],"up":[{"embeddable":true,"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=\/wp\/v2\/pages\/5636"}],"wp:attachment":[{"href":"https:\/\/madnesslabo.net\/utage\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}