コード例 #1
0
        /// <summary>
        /// Remove callback from the instance.
        /// </summary>
        /// <param name="callback">The callback to remove.</param>
        /// <param name="useTrickleDown">Set this parameter to true to remove the callback from the TrickleDown phase. Set this parameter to false to remove the callback from the BubbleUp phase.</param>
        public void UnregisterCallback <TEventType, TUserArgsType>(EventCallback <TEventType, TUserArgsType> callback, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase <TEventType>, new()
        {
            if (m_CallbackRegistry != null)
            {
                m_CallbackRegistry.UnregisterCallback(callback, useTrickleDown);
            }

            GlobalCallbackRegistry.UnregisterListeners <TEventType>(this, callback);
        }
コード例 #2
0
        public void UnregisterCallback <TEventType>(EventCallback <TEventType> callback, TrickleDown useTrickleDown = TrickleDown.NoTrickleDown) where TEventType : EventBase <TEventType>, new()
        {
            bool flag = this.m_CallbackRegistry != null;

            if (flag)
            {
                this.m_CallbackRegistry.UnregisterCallback <TEventType>(callback, useTrickleDown);
            }
            GlobalCallbackRegistry.UnregisterListeners <TEventType>(this, callback);
        }