private void OnDestroy()
        {
            if (Dependencies.RemoteGameServer != null)
            {
                Dependencies.RemoteGameServer.ConnectionStateChanged -= OnRemoteGameServerConnectionStateChanged;
            }

            if (m_matchServer != null)
            {
                m_matchServer.Tick                   -= OnTick;
                m_matchServer.ReadyToPlayAll         -= OnReadyToPlayAll;
                m_matchServer.Ping                   -= OnPing;
                m_matchServer.Paused                 -= OnPaused;
                m_matchServer.ConnectionStateChanged -= OnConnectionStateChanged;
            }

            if (m_taskEngines != null)
            {
                for (int i = 0; i < m_taskEngines.Length; ++i)
                {
                    ITaskEngine taskEngine = m_taskEngines[i];
                    if (taskEngine != null)
                    {
                        taskEngine.ClientRequest -= ProcessClientRequest;
                        MatchFactoryCli.DestroyTaskEngine(taskEngine);
                    }
                }
            }

            if (m_taskRunners != null)
            {
                for (int i = 0; i < m_taskRunners.Length; ++i)
                {
                    ITaskRunner taskRunner = m_taskRunners[i];
                    if (taskRunner != null)
                    {
                        MatchFactoryCli.DestroyTaskRunner(taskRunner);
                    }
                }
            }

            if (m_pathFinders != null)
            {
                for (int i = 0; i < m_pathFinders.Length; ++i)
                {
                    IPathFinder pathFinder = m_pathFinders[i];
                    if (pathFinder != null)
                    {
                        MatchFactoryCli.DestroyPathFinder(pathFinder);
                    }
                }
            }

            if (m_bots != null)
            {
                for (int i = 0; i < m_bots.Length; ++i)
                {
                    IBotController botController = m_bots[i];
                    if (botController != null)
                    {
                        MatchFactoryCli.DestroyBotController(botController);
                    }
                }
            }
        }