getEventByID() public method

public getEventByID ( System.Guid guid, EventDescription &_event ) : RESULT
guid System.Guid
_event EventDescription
return RESULT
Exemplo n.º 1
0
        public EventDescription GetEvent(Guid id)
        {
            FMOD.Studio.EventDescription evt;
            _system.getEventByID(id, out evt).Check();

            return(EventDescription.FromFmod(evt));
        }
Exemplo n.º 2
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.getEventByID(id, 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);
    }