Esempio n. 1
0
        /// <summary>
        /// Unregister to the button events
        /// </summary>
        private void OnDisable()
        {
            if (!_registered)
            {
                return;
            }
            if (_provider == null)
            {
                return;
            }

            _provider.Unsubscribe(ProcessButtonEvents);
            _registered = false;
        }
        /// <summary>
        /// Disconnects all the components in the childrens to the main Event Provider
        /// </summary>
        private void OnDisable()
        {
            if (_broadcaster == null)
            {
                return;
            }
            if (_controllers == null)
            {
                return;
            }

            for (int i = 0; i < _controllers.Length; ++i)
            {
                _broadcaster.Unsubscribe(_controllers[i].OnMetaButtonEvent);
            }
        }