コード例 #1
0
    public static bool CreateIfNeededGlobalEvent(string globalEventName)
    {
        FsmEvent _event = FsmEvent.GetFsmEvent(globalEventName);

        bool result = false;

        if (!FsmEvent.IsEventGlobal(globalEventName))
        {
            if (_event == null)
            {
                _event = new FsmEvent(globalEventName)
                {
                    IsGlobal = true
                };
                FsmEvent.AddFsmEvent(_event);
                if (!FsmEvent.globalEvents.Contains(globalEventName))
                {
                    FsmEvent.globalEvents.Add(globalEventName);
                }
            }

            result = true;
        }

        return(result);
    }
コード例 #2
0
 void CreateGlobalEvent(string globalEventName)
 {
     if (!FsmEvent.IsEventGlobal(globalEventName))
     {
         FsmEvent _event = new FsmEvent(globalEventName);
         _event.IsGlobal = true;
         FsmEvent.AddFsmEvent(_event);
     }
 }
コード例 #3
0
 public static void CreateIfNeededGlobalEvent(string globalEventName)
 {
     if (!FsmEvent.IsEventGlobal(globalEventName))
     {
         // Setup global events
         FsmEvent _event = new FsmEvent(globalEventName);
         _event.IsGlobal = true;
         FsmEvent.AddFsmEvent(_event);
     }
 }
コード例 #4
0
    /// <summary>
    /// Creates the global event if needed.
    /// </summary>
    /// <returns><c>true</c>, if global event was created <c>false</c> if event existed already.</returns>
    /// <param name="EventName">Event name.</param>
    public FsmEvent CreateGlobalEvent(string EventName, out bool ExistsAlready)
    {
        FsmEvent _event = FsmEvent.GetFsmEvent(EventName);

        ExistsAlready = FsmEvent.EventListContains(EventName);

        if (ExistsAlready)
        {
            if (_event != null && _event.IsGlobal)
            {
                _event.IsGlobal = true;
            }

            return(_event);
        }

        _event          = new FsmEvent(EventName);
        _event.IsGlobal = true;
        FsmEvent.AddFsmEvent(_event);

        return(_event);
    }