Files
Fishing2/Assets/Obvious/Soap/Examples/Content/Scripts/Player.cs
2025-11-10 00:08:26 +08:00

28 lines
679 B
C#

using UnityEngine;
using UnityEngine.Events;
namespace Obvious.Soap.Example
{
public class Player : MonoBehaviour
{
[SerializeField] private ScriptableListPlayer scriptableListPlayer = null;
[SerializeField] private PlayerVariable _playerVariable = null;
[SerializeField] private UnityEvent _onNotified = null;
private void Awake()
{
_playerVariable.Value = this;
scriptableListPlayer.TryAdd(this);
}
private void OnDestroy()
{
scriptableListPlayer.Remove(this);
}
public void Notify()
{
_onNotified?.Invoke();
}
}
}