WuhuIslandTesting/Library/PackageCache/com.stresslevelzero.marrow.sdk@1.2.0/Scripts/SLZ.Marrow/SLZ.Marrow.Zones/ZoneLinkItem.cs

30 lines
804 B
C#
Raw Normal View History

2025-01-07 02:06:59 +01:00
using System;
using UnityEngine;
namespace SLZ.Marrow.Zones
{
public class ZoneLinkItem : MonoBehaviour, IZoneLinkListenable, IZoneLinkPrimaryListenable, IZoneLinkSecondaryListenable
{
[Flags]
public enum EventTypes
{
Primary = 1 << 0,
Secondary = 1 << 1
}
[SerializeField]
protected ZoneLink _zoneLink;
[EnumFlags, SerializeField]
protected EventTypes _eventTypes = EventTypes.Primary | EventTypes.Secondary;
#if UNITY_EDITOR
protected virtual void Reset()
{
_zoneLink = GetComponent<ZoneLink>();
if (_zoneLink != null || transform.parent == null)
return;
_zoneLink = transform.parent.GetComponent<ZoneLink>();
}
#endif
}
}