top of page

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

2023年10月28日
読了時間: 1分


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



コンポーネントを削除

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


こっちでも可

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

コメント


bottom of page