Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/Moonlit/FootstepPro/IStepDetector.cs
2026-02-21 16:45:37 +08:00

49 lines
780 B
C#

using UnityEngine;
namespace Moonlit.FootstepPro
{
[SerializeField]
[RequireComponent(typeof(Foot))]
public abstract class IStepDetector : MonoBehaviour
{
public enum CombineType
{
Required = 0,
Optional = 1
}
[SerializeField]
protected CombineType _Type;
public CombineType Type
{
get
{
return _Type;
}
}
public abstract bool Detect(Foot foot);
public abstract void Callback(bool footPlaced);
public void OnEnable()
{
Foot component = GetComponent<Foot>();
if (!component.Detectors.Contains(this))
{
component.Detectors.Add(this);
}
}
public void OnDisable()
{
Foot component = GetComponent<Foot>();
if (component.Detectors.Contains(this))
{
component.Detectors.Remove(this);
}
}
}
}