The topic with the same title here
How to efficiently spawn & render many cube prefabs for a voxel world?
is actually asking about efficiently rendering.
Assume I need to instantiate a lot of game objects. Without using ECS, anyway to batch the instantiating?
The traditional codes I thought:
for (int i = 0; i < n; ++i)
{
Instantiate(prefab, parent);
}
compared with the ECS approach:
NativeArray<Entity> entitiesHolder =
entityMgr.Instantiate(prefab, n, Allocator.Persistent);
The for loop approach is very ill performance, while the ECS approach is extraonary good, beyond the imagination. But in my case, the currently working feature can't implement ECS.
So, in Unity traditional, are there anyway to batch the instantiating?