Пример #1
0
 private void RemoveListener(Action callback)
 {
     m_callbacks.Remove(callback);
     if (m_callbacks.Count == 0 && m_listenerGameObject != null)
     {
         DestroyUtility.Destroy(m_listenerGameObject.get_gameObject());
     }
 }
Пример #2
0
 private void AddListener(Action callback)
 {
     //IL_0020: Unknown result type (might be due to invalid IL or missing references)
     m_callbacks.Add(callback);
     if (m_callbacks.Count == 1)
     {
         m_listenerGameObject = new GameObject("SceneEventListener").AddComponent <SceneEventListenerBehaviour>();
         Object.DontDestroyOnLoad(m_listenerGameObject.get_gameObject());
     }
 }