Пример #1
0
        public static void PreviewEvent(EditorEventRef eventRef)
        {
            bool load = true;

            if (previewEventDesc != null)
            {
                Guid guid;
                previewEventDesc.getID(out guid);
                if (guid == eventRef.Guid)
                {
                    load = false;
                }
                else
                {
                    PreviewStop();
                }
            }

            if (load)
            {
                CheckResult(System.loadBankFile(EventManager.MasterBank.Path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out masterBank));
                CheckResult(System.loadBankFile(eventRef.Banks[0].Path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out previewBank));

                CheckResult(System.getEventByID(eventRef.Guid, out previewEventDesc));
                CheckResult(previewEventDesc.createInstance(out previewEventInstance));
            }

            CheckResult(previewEventInstance.start());
        }
Пример #2
0
 /// <summary>
 /// Retrieves an event via 128-bit GUID.
 /// To parse a GUID from a string id, i.e. "{2a3e48e6-94fc-4363-9468-33d2dd4d7b00}", use FMOD.Studio.Util.parseID().
 /// </summary>
 public static EventDescription GetEvent(Guid id)
 {
     Native.getEventByID(id, out FMOD.Studio.EventDescription eventDescription);
     return(new EventDescription(eventDescription));
 }