evershade/Packages/super-tiled2unity.v2.2.0/Editor/Importers/TmxAssetImporter.GroupLayer.cs

27 lines
893 B
C#

using System.Xml.Linq;
using UnityEngine;
namespace SuperTiled2Unity.Editor
{
public partial class TmxAssetImporter
{
private SuperLayer ProcessGroupLayer(GameObject goParent, XElement xGroup)
{
var groupLayerComponent = goParent.AddSuperLayerGameObject<SuperGroupLayer>(new SuperGroupLayerLoader(xGroup, this), SuperImportContext);
AddSuperCustomProperties(groupLayerComponent.gameObject, xGroup.Element("properties"));
// Group layers can contain other layers
RendererSorter.BeginGroupLayer(groupLayerComponent);
using (SuperImportContext.BeginIsTriggerOverride(groupLayerComponent.gameObject))
{
ProcessMapLayers(groupLayerComponent.gameObject, xGroup);
}
RendererSorter.EndGroupLayer();
return groupLayerComponent;
}
}
}