WuhuIslandTesting/Library/PackageCache/com.stresslevelzero.marrow.sdk@1.2.0/Scripts/SLZ.Marrow/SLZ.Marrow.Zones/ZoneAggro.cs
2025-01-07 02:06:59 +01:00

38 lines
No EOL
1.1 KiB
C#

using SLZ.Marrow.Warehouse;
using UnityEngine;
namespace SLZ.Marrow.Zones
{
[RequireComponent(typeof(ZoneLink), typeof(Zone))]
[AddComponentMenu("MarrowSDK/Zones/Zone Aggro")]
public class ZoneAggro : MonoBehaviour, IZoneEntityListenable
{
[SerializeField]
private Zone _zone;
[SerializeField]
private ZoneLink _zoneLink;
public MarrowQuery beingTags = new();
public MarrowQuery playerTag = new();
void Reset()
{
_zone = GetComponent<Zone>();
_zoneLink = GetComponent<ZoneLink>();
var query = new TagQuery();
BoneTagReference btRef = new BoneTagReference(MarrowSettings.RuntimeInstance.BeingTag.Barcode);
query.BoneTag = btRef;
beingTags.Tags.Add(query);
if (playerTag.Tags.Count < 1)
{
var queryPlayer = new TagQuery();
BoneTagReference playerRef = new BoneTagReference(MarrowSettings.RuntimeInstance.PlayerTag.Barcode);
queryPlayer.BoneTag = playerRef;
playerTag.Tags.Add(queryPlayer);
}
}
}
}