実行時にプレハブをインスタンス化して破壊する必要があります。私はこれらを試してみました:Unity3Dのインスタンシエーションと破壊
public Transform prefab; //I attached a prefab in Unity Editor
Object o = Instantiate(prefab);
//using this I cannot get the transform component (I don't know why) so useless
Transform o=(Transform)Instantiate(prefab);
//gives transform and transform component cannot be destroyed
GameObject o=(GameObject)Instantiate(prefab);
//invalid cast
それではどうやってですか?
。これはすべて変数TYPEに関するものです。 – Chchwy