top of page

【Unity】スクリプトからコンポーネントを削除する方法

  • 執筆者の写真: ye
    ye
  • 2023年10月28日
  • 読了時間: 1分


最近よく使う構文なので、覚書き。



コンポーネントを削除

Destroy(Object.GetComponent<Object名>());


こっちでも可

targetScript = Object.GetComponent<Object名>();
Destroy(targetScript)

bottom of page