Evento da Unidade

using UnityEngine;
using UnityEngine.Events;


public class event_test : MonoBehaviour
{
    UnityEvent my_event=new UnityEvent();

    void Start()
    {
        my_event.AddListener(On_change);
    }
    void Update()
    {
        if(Input.GetKeyDown(KeyCode.Escape))
        {
            my_event.Invoke();
        }
    }
    void On_change()
    {
        Debug.Log("value changed to ");
    }
}
Funny Fly