<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>uni-mal</author_name>
  <author_url>https://blog.hatena.ne.jp/uni-mal/</author_url>
  <blog_title>Unityでインディゲームを作る！</blog_title>
  <blog_url>https://indie-game-creation-with-unity.hatenablog.com/</blog_url>
  <categories>
    <anon>Unity</anon>
  </categories>
  <description>Unityにおける各コンポーネントはスクリプトも含めて、enabled変数（bool）でその有効無効（アクティブ状態）を設定できます。 機能を止めたい時はenabled = false;とやれば止まりますし、そのゲームオブジェクト全体を停止させたい時はSetActiveを使います。 ただ今回、ある疑問が浮上しまして、それはスクリプトを無効にしても、OnTriggerEnterによる処理がなされるんじゃないか、というものです。 SetActiveとEnabled 単純にゲームオブジェクトを消したい時、Destroyを使うと負担が大きく、特にWebGLだとIncremental GCが使えないので…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Findie-game-creation-with-unity.hatenablog.com%2Fentry%2Fon-trigger-enter-of-disabled-script&quot; title=&quot;Unity OnTriggerEnterの呼び出しがスクリプトの有効無効を貫通する！？ - Unityでインディゲームを作る！&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/u/uni-mal/20220109/20220109090040.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-01-09 10:13:52</published>
  <title>Unity OnTriggerEnterの呼び出しがスクリプトの有効無効を貫通する！？</title>
  <type>rich</type>
  <url>https://indie-game-creation-with-unity.hatenablog.com/entry/on-trigger-enter-of-disabled-script</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
