25 lines
910 B
C#
25 lines
910 B
C#
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<LocationSegment>();
|
|
}
|
|
|
|
public override void ProcessBrushEntity(MapBsp mapBsp, BspEntity entity, GameObject brush)
|
|
{
|
|
if (entity.GetClassname() != "func_LocationSegmentTrigger") return;
|
|
|
|
var locationSegmentTrigger = brush.GetComponent<LocationSegmentTrigger>();
|
|
locationSegmentTrigger.segment = _locationSegment;
|
|
|
|
_locationSegment.triggers.Add(locationSegmentTrigger);
|
|
}
|
|
}
|
|
} |