Destroy may not be called from edit mode! Use DestroyImmediate instead. Also think twice if you really want to destroy something in edit mode. Since this will destroy objects permanently.
エディタ拡張の処理でGameObject.Destroy
を呼び出すと上記のエラーが発生します
エディタ拡張でゲームオブジェクトを削除したいときは
GameObject.DestroyImmediate
を使用する必要があります