Unity and Cocos stay as parallel schemes; apps/minigame ships the Godot 4.7 WeChat pack for DevTools. Co-authored-by: Cursor <cursoragent@cursor.com>
15 lines
381 B
TypeScript
15 lines
381 B
TypeScript
import mitt, { type Emitter } from '../vendor/mitt'
|
|
import type { GameEvents } from './GameEvents'
|
|
|
|
/** Process-wide typed bus. Sim and Cocos views both subscribe here. */
|
|
let bus: Emitter<GameEvents> | null = null
|
|
|
|
export function getBus(): Emitter<GameEvents> {
|
|
if (!bus) bus = mitt<GameEvents>()
|
|
return bus
|
|
}
|
|
|
|
export function resetBus(): void {
|
|
bus = mitt<GameEvents>()
|
|
}
|