I tried destroying the Child Objects both before and after calling the UniqueObjectManager.DestroyObject(this.gameObject); function and it still throws the same error and won't destroy the Parent Object Prefab that is supposed to be listed.
I tried this:
Code: Select all
// Destroy All Child Objects within this Object, if any.
foreach (Transform child in transform)
{
GameObject.Destroy(child.gameObject);
}
// Now Destroy Parent Object.
UniqueObjectManager.DestroyObject(this.gameObject);
Code: Select all
// Destroy Parent Object First.
UniqueObjectManager.DestroyObject(this.gameObject);
// Destroy All Child Objects within this Object, if any.
foreach (Transform child in transform)
{
GameObject.Destroy(child.gameObject);
}