示例#1
0
        /// <summary>
        /// Removes all event handlers
        /// </summary>
        /// <param name="deep">Specifies if all local registered event handlers
        /// should also be removed</param>
        public static void RemoveAllHandlers(bool deep)
        {
            if (deep)
            {
                if (Lock.TryEnterWriteLock(LOCK_TIMEOUT))
                {
                    try
                    {
                        m_gameObjectEventCollections.Clear();
                    }
                    finally
                    {
                        Lock.ExitWriteLock();
                    }
                }
                else
                {
                    log.ErrorFormat("Timeout exceeded on attempt to RemoveAllHandlers.");
                }
            }

            GlobalHandlerCollection.RemoveAllHandlers();
        }