コード例 #1
0
        private void TriggerEvent(GameEvent e)
        {
            List <GameEventHandler> handlerList = null;

            if (eventHandlerDic.TryGetValue(e.EventID, out handlerList))
            {
                if (handlerList != null && handlerList.Count > 0)
                {
                    for (int i = 0; i < handlerList.Count; i++)
                    {
                        if (handlerList[i] != null)
                        {
                            handlerList[i](e);

                            eventPool.PutItem(e);
                        }
                    }
                }
            }
        }