getEvent() public method

public getEvent ( string path, EventDescription &_event ) : RESULT
path string
_event EventDescription
return RESULT
Beispiel #1
0
        public void PlayTestSound()
        {
            string           eventPath = "event:/Music/Start/Splash";
            EventDescription eventDescription;
            RESULT           res = _system.getEvent(eventPath, out eventDescription);
            EventInstance    testEventInstance;

            res = eventDescription.createInstance(out testEventInstance);
            _testEventInstance = testEventInstance;
            res = _testEventInstance.Value.setVolume(1.0f);
            res = _testEventInstance.Value.start();
            res = _system.update();
        }
Beispiel #2
0
        public EventDescription GetEvent(string path)
        {
            FMOD.Studio.EventDescription evt;
            _system.getEvent(path, out evt).Check();

            return(EventDescription.FromFmod(evt));
        }
 private static EventDescription GetEventDescription(string path)
 {
     if (cachedEventDescriptions.ContainsKey(path))
     {
         return(cachedEventDescriptions[path]);
     }
     CheckResult(system.getEvent(path, out var description));
     description.loadSampleData();
     cachedEventDescriptions.Add(path, description);
     return(description);
 }
Beispiel #4
0
    public FMOD.Studio.EventInstance GetEvent(string path)
    {
        FMOD.Studio.EventInstance instance = null;

        if (string.IsNullOrEmpty(path))
        {
            FMOD.Studio.UnityUtil.LogError("Empty event path!");
            return(null);
        }

        if (eventDescriptions.ContainsKey(path))
        {
            ERRCHECK(eventDescriptions[path].createInstance(out instance));
        }
        else
        {
            FMOD.GUID id = new FMOD.GUID();

            if (path.StartsWith("{"))
            {
                ERRCHECK(FMOD.Studio.Util.ParseID(path, out id));
            }
            else if (path.StartsWith("event:"))
            {
                ERRCHECK(system.lookupID(path, out id));
            }
            else
            {
                FMOD.Studio.UnityUtil.LogError("Expected event path to start with 'event:/'");
            }

            FMOD.Studio.EventDescription desc = null;
            ERRCHECK(system.getEvent(id, FMOD.Studio.LOADING_MODE.BEGIN_NOW, out desc));

            if (desc != null && desc.isValid())
            {
                eventDescriptions.Add(path, desc);
                ERRCHECK(desc.createInstance(out instance));
            }
        }

        if (instance == null)
        {
            FMOD.Studio.UnityUtil.Log("GetEvent FAILED: \"path\"");
        }

        return(instance);
    }
        public SoundFile(Bankfile bankFileToConvert, FMOD.Studio.System systemToLoadFrom)
        {
            systemToLoadFrom.loadBankFile(bankFileToConvert.BankName, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL,
                                          out var mainBank);
            systemToLoadFrom.loadBankFile(bankFileToConvert.BankStringName, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL,
                                          out var stringBank);
            Banks[0] = mainBank;
            Banks[1] = stringBank;

            foreach (var @event in bankFileToConvert.Events)
            {
                systemToLoadFrom.getEvent($"event:/{@event.EventName}", out var tempDescription);
                EventDescriptions.Add(@event.SongId, new EventFile(
                                          tempDescription, new EventInstance(), @event.EventName));
            }
        }
Beispiel #6
0
    public FMOD.Studio.EventInstance getEvent(string path)
    {
        FMOD.Studio.EventInstance instance = null;

        if (string.IsNullOrEmpty(path))
        {
            Debug.LogError("Empty event path!");
            return(null);
        }

        if (eventDescriptions.ContainsKey(path))
        {
            ERRCHECK(eventDescriptions[path].createInstance(out instance));
        }
        else
        {
            FMOD.GUID id = new FMOD.GUID();

            if (path.StartsWith("{"))
            {
                ERRCHECK(FMOD.Studio.Util.ParseID(path, out id));
            }
            else if (path.StartsWith("/"))
            {
                ERRCHECK(system.lookupEventID(path, out id));
            }
            else
            {
                Debug.LogError("Expected event path to start with '/'");
            }

            FMOD.Studio.EventDescription desc = null;
            ERRCHECK(system.getEvent(id, FMOD.Studio.LOADING_MODE.BEGIN_NOW, out desc));

            eventDescriptions.Add(path, desc);
            ERRCHECK(desc.createInstance(out instance));
        }

//		Debug.Log("get event: " + (instance != null ? "suceeded!!" : "failed!!")); //PAS

        return(instance);
    }