Re: Creating an Automatic Save Structure
Posted: Fri Jul 14, 2017 5:03 am
Thanks, but it doesn't seem to work.
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:
And this:
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);
}