public static void BuildEntityLayerInstances(LDtkDataLayer layerData, LDtkEntityAssetCollection entityAssets, int layerSortingOrder) { LDtkParsedPoint.InformOfRecentLayerVerticalCellCount(layerData.__cHei); GameObject layerObj = new GameObject(layerData.__identifier); foreach (LDtkDataEntity entityData in layerData.entityInstances) { BuildEntityInstance(layerData, entityData, entityAssets, layerObj, layerSortingOrder); } }
public void BuildEntityLayerInstances() { if (Importer.DeparentInRuntime) { LayerGameObject.AddComponent <LDtkDetachChildren>(); } SortingOrder.Next(); LDtkParsedPoint.InformOfRecentLayerVerticalCellCount(Layer.UnityWorldPosition, (int)Layer.CHei); foreach (EntityInstance entityData in Layer.EntityInstances) { GameObject entityPrefab = Importer.GetEntity(entityData.Identifier); if (entityPrefab == null) { continue; } BuildEntityInstance(entityData, entityPrefab); } }