using TinyGoose.Tremble; using UnityEngine; namespace Code.Game.OfficeGame.Location { public class LocationSegmentPreProcessor : MapProcessorBase { // Seems safe to be inaccurate private LocationSegment _locationSegment; public override void ProcessWorldSpawnProperties(MapBsp mapBsp, BspEntity entity, GameObject rootGameObject) { _locationSegment = rootGameObject.GetComponentInChildren(); } public override void ProcessBrushEntity(MapBsp mapBsp, BspEntity entity, GameObject brush) { if (entity.GetClassname() != "func_LocationSegmentTrigger") return; var locationSegmentTrigger = brush.GetComponent(); locationSegmentTrigger.segment = _locationSegment; _locationSegment.triggers.Add(locationSegmentTrigger); } } }