前言
上一篇记录了框架的事件系统的内部构成和实现,这篇记录下事件系统的使用。
如何使用
新建脚本EventTest
using JKFrame;
using UnityEngine;
public class EventTest : MonoBehaviour
{
    
    void Start()
    {
        //添加监听
       EventSystem.AddEventListener("inputC",InputKey); 
    }
    
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.C))
        {
            //触发事件
            EventSystem.EventTrigger("inputC");
        }
    }
    public void InputKey()
    {
        Debug.Log("按下了c键");
    }
}
脚本挂载到场景中,运行执行











