1 Star 1 Fork 31

LShrimp游戏 / ccc-tnt-framework

forked from 伍拾陆 / ccc-tnt-framework 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
事件管理.md 461 Bytes
一键复制 编辑 原始数据 按行查看 历史
伍拾陆 提交于 2023-06-30 16:45 . ..

事件管理

EventMgr

方法

on once off offAllOfKey targetOff emit emitSticky clear hasEventListener hasEvent

使用方式与引擎的事件管理基本一致,尽量保证 on、off 成对出现,或者直接使用 targetOff

  tnt.eventMgr.on("key1",()=>{},this);
  tnt.eventMgr.on("key2",()=>{},this);
  tnt.eventMgr.on("key3",()=>{},this);

  
  tnt.eventMgr.targetOff(this);
1
https://gitee.com/lshrimp-game/ccc-tnt-framework.git
git@gitee.com:lshrimp-game/ccc-tnt-framework.git
lshrimp-game
ccc-tnt-framework
ccc-tnt-framework
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891