class EventManager extends egret.EventDispatcher { private constructor() { super(); } private static instance: EventManager = null; private static getInstance1(): EventManager { return EventManager.instance; } private static getInstance(): EventManager { if (!EventManager.instance) { EventManager.instance = new EventManager(); EventManager.getInstance = EventManager.getInstance1; } return EventManager.instance; } }