CangJie/Assets/Scripts//PlayerInteract.cs
2022-03-13 23:27:31 +08:00

32 lines
613 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Sirenix.OdinInspector;
/// <summary>
/// 玩家交互组件,挂在玩家下面的子物体中
/// </summary>
public class PlayerInteract : MonoBehaviour
{
[SerializeField][ReadOnly]
private Event catched;
public void SetCatched(Event e)
{
catched = e;
}
public void CancleCatched(Event e)
{
if (e == catched)
{
catched = null;
}
}
public void OnCall()
{
if (catched != null)
{
catched.OnCall();
}
}
}