void Awake() { if (_instance == null) { _instance = this; collEnterEventData = new Dictionary <int, List <EventManager.EDCollisionEnter> >(); collStayEventData = new Dictionary <int, List <EventManager.EDCollisionStay> >(); collExitEventData = new Dictionary <int, List <EventManager.EDCollisionExit> >(); triggerEnterEventData = new Dictionary <int, List <EventManager.EDTriggerEnter> >(); triggerStayEventData = new Dictionary <int, List <EventManager.EDTriggerStay> >(); triggerExitEventData = new Dictionary <int, List <EventManager.EDTriggerExit> >(); allCollisionAndTriggerInfo = new Dictionary <int, CollisionAndTriggerInfoBundle>(); internalCollData = new List <CollisionDataInternal>(); internalCollEnterData = new List <CollisionEnterDataInternal>(); internalTriggerStayExitData = new List <TriggerStayExitDataInternal>(); internalTriggerEnterData = new List <TriggerEnterDataInternal>(); // start coroutine to send collision data via callbacks lateFixedUpdate = LateFixedUpdateCoroutine(); StartCoroutine(lateFixedUpdate); } }
public void OnDestroy() { _instance = null; }