using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.Events; using UnityEngine.Serialization; using UnityEngine.UI; public class EnablePlay : MonoBehaviour { [System.Serializable] public class PlayEvent : UnityEvent { } [FormerlySerializedAs("onPlay")] [SerializeField] [Space(10)] private PlayEvent m_OnPlay = new PlayEvent(); public PlayEvent OnPlayPlay { get { return m_OnPlay; } set { m_OnPlay = value; } } private void OnEnable() { OnPlayPlay.Invoke(); } }