Exemplo n.º 1
0
    public static void TriggerEvent(string eventName, GameMessage message)
    {
        if (Instance == null)
        {
            return;
        }
        List <string> ignoreList = new List <string>();

        if (Instance.enableDebugging == true)
        {
            //ignoreList.Add(EventName.System.Sheep.Roam());
            ignoreList.Add(EventName.Input.Player.Move());
            ignoreList.Add(EventName.System.Economy.PortalProgress());
        }
        UnityGameEvent thisEvent = null;

        if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            if (Instance.enableDebugging == true)
            {
                if (!ignoreList.Contains(eventName))
                {
                    Debug.LogWarning("M:" + eventName + ": " + DebugHelper.PrintGameMessage(message));
                }
            }
            thisEvent.Invoke(message);

            /*             try {
             *              thisEvent.Invoke(message);
             *          } catch {
             *              Debug.LogError("EventCoordinator event.Invoke failed: " + eventName + "  <with message>:  " + DebugHelper.PrintGameMessage(message));
             *          } */
        }
        if (Instance.attachmentsDictionary.TryGetValue(eventName, out thisEvent))
        {
            /*             if (Instance.enableDebugging == true){
             *              if(!ignoreList.Contains(eventName))
             *                  Debug.LogWarning("A:"+eventName + ": " + message);
             *          } */
            thisEvent.Invoke(message);

            /*             try {
             *              thisEvent.Invoke(message);
             *          } catch {
             *              Debug.LogError("EventCoordinator attachment.Invoke failed: " + eventName + "  <with message>:  " + DebugHelper.PrintGameMessage(message));
             *          } */
        }
    }
Exemplo n.º 2
0
    public static void TriggerEvent(string eventName, GameMessage message)
    {
        if (instance.enableDebugging == true)
        {
            Debug.LogWarning(eventName + ": " + message);
        }
        UnityGameEvent thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(message);
        }
        if (instance.attachmentsDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(message);
        }
    }
Exemplo n.º 3
0
        public static void TriggerEvent(string eventName, GameEventArgs args)
        {
            UnityGameEvent thisEvent = null;

            if (_eventDictionary.TryGetValue(eventName, out thisEvent))
            {
                thisEvent.Invoke(args);
            }
        }
    public static void TriggerEvent(string eventName, GameMessage message)
    {
        if (Instance == null)
        {
            return;
        }
        UnityGameEvent thisEvent = null;

        if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            if (Instance.enableDebugging == true)
            {
                if (!Instance.ignoreEvents.list.Contains(eventName))
                {
                    //Debug.LogWarning("M:" + eventName + ": " + DebugHelper.PrintGameMessage(message));
                    Debug.LogWarning("M:" + eventName + ": " + message);
                }
            }
            thisEvent.Invoke(message);

            /*             try {
             *              thisEvent.Invoke(message);
             *          } catch {
             *              Debug.LogError("EventCoordinator event.Invoke failed: " + eventName + "  <with message>:  " + DebugHelper.PrintGameMessage(message));
             *          } */
        }
        if (Instance.attachmentsDictionary.TryGetValue(eventName, out thisEvent))
        {
            if (Instance.showAttachedEvents && Instance.enableDebugging)
            {
                if (!Instance.ignoreAttachedEvents.list.Contains(eventName))
                {
                    Debug.LogWarning("M:" + eventName + ": " + message);
                }
            }
            thisEvent.Invoke(message);

            /*             try {
             *              thisEvent.Invoke(message);
             *          } catch {
             *              Debug.LogError("EventCoordinator attachment.Invoke failed: " + eventName + "  <with message>:  " + DebugHelper.PrintGameMessage(message));
             *          } */
        }
    }
Exemplo n.º 5
0
    public static void TriggerEvent(string eventName, GameMessage message)
    {
        if (Instance == null)
        {
            return;
        }
        if (Instance.enableDebugging == true)
        {
            //ignoreList.Add(EventName.System.Sheep.Roam());
            //ignoreList.Add(EventName.System.Economy.EatGrass());
            //ignoreList.Add(EventName.System.Player.PlayerCardsSorted());
            //ignoreList.Add(EventName.System.Player.ProfileUpdate());
            //ignoreList.Add(EventName.System.BaseTargetUpdate());
        }
        UnityGameEvent thisEvent = null;

        if (Instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            if (Instance.enableDebugging == true)
            {
                if (!Instance.debugIgnoreList.Contains(eventName))
                {
                    Debug.LogWarning("M:" + eventName + ": " + DebugHelper.PrintGameMessage(message));
                }
            }
            thisEvent.Invoke(message);
        }
        if (Instance.attachmentsDictionary.TryGetValue(eventName, out thisEvent))
        {
/*             if (Instance.enableDebugging == true){
 *              if(!ignoreList.Contains(eventName))
 *                  Debug.LogWarning("A:"+eventName + ": " + message);
 *          } */
            thisEvent.Invoke(message);
        }
    }
 void UseAbility()
 {
     OnUseEvent.Invoke();
 }