コード例 #1
0
    /// <summary>
    /// Add if necessary a list of Global events to the PlayMaker Globals resources to be available in the global events list
    /// </summary>
    /// <param name="events"></param>
    public static void CreateGlobalEventsIfNeeded(string[] events)
    {
        bool _isDirty = false;


        foreach (string _eventName in events)
        {
            if (!FsmEvent.IsEventGlobal(_eventName))
            {
                PlayMakerGlobals.AddGlobalEvent(_eventName);
                //	Debug.Log("Adding global event: "+_eventName);
                _isDirty = true;
            }
        }

        if (_isDirty)
        {
            FsmEditor.SaveGlobals();
            for (int index = 0; index < FsmEvent.globalEvents.Count; ++index)
            {
                new FsmEvent(FsmEvent.globalEvents[index]).IsGlobal = true;
            }


            FsmEventsWindow.ResetView();
        }
    }
        public static void SanitizeGlobalEventSetup()
        {
            Debug.Log("PlayMaker Photon : Sanitizing Global Events");

            bool _eventAdded = true;

//				Debug.Log("Creating Photon Events");
            foreach (string _event in PlayMakerPunLUT.PhotonEvents)
            {
                if (PlayMakerUtils.CreateIfNeededGlobalEvent(_event))
                {
                    _eventAdded = true;
                }
            }

            if (_eventAdded)
            {
                FsmEditor.SaveGlobals();
            }
        }