new-horizons/NewHorizons/Components/Volumes/MapRestrictionVolume.cs

27 lines
684 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace NewHorizons.Components.Volumes
{
public class MapRestrictionVolume : BaseVolume
{
public override void OnTriggerVolumeEntry(GameObject hitObj)
{
if (hitObj.CompareTag("PlayerDetector"))
{
Locator.GetMapController()?.OnPlayerEnterMapRestriction();
}
}
public override void OnTriggerVolumeExit(GameObject hitObj)
{
if (hitObj.CompareTag("PlayerDetector"))
{
Locator.GetMapController()?.OnPlayerExitMapRestriction();
}
}
}
}