Closed sbtoonz closed 2 years ago
I don't think (but could be wrong) that this solution works. I don't think that this will cause the spawned objects to be parented under the pool because GetNetworkObjectInternal
will reset their parent again to null.
As for cleaning up the hiearchy if this is wanted I'd suggest to add your code in this PR but remove the parenting uses in GetNetworkObjectInternal and ReturnNetworkObject that way all the objects will always be parented under the pool. But I don't think that's something we'd want for this implementation here.
Would leave hierarchy view much cleaner and organized in my scene view to attach the instantiated prefabs to the transform of the networkobject pool