public void RemoveGizmosListener(Action callback) { RemoveListener(callback); SceneEventListenerBehaviour listenerGameObject = m_listenerGameObject; listenerGameObject.onDrawGizmos = (Action)Delegate.Remove(listenerGameObject.onDrawGizmos, callback); }
public void RemoveUpdateListener(Action callback) { RemoveListener(callback); SceneEventListenerBehaviour listenerGameObject = m_listenerGameObject; listenerGameObject.onUpdate = (Action)Delegate.Remove(listenerGameObject.onUpdate, callback); }
public void AddGizmosListener(Action callback) { AddListener(callback); SceneEventListenerBehaviour listenerGameObject = m_listenerGameObject; listenerGameObject.onDrawGizmos = (Action)Delegate.Combine(listenerGameObject.onDrawGizmos, callback); }
public void AddUpdateListener(Action callback) { AddListener(callback); SceneEventListenerBehaviour listenerGameObject = m_listenerGameObject; listenerGameObject.onUpdate = (Action)Delegate.Combine(listenerGameObject.onUpdate, callback); }
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()); } }