public EventInstance GetEvent(string path)
{
EventInstance eventInstance = null;
if (string.IsNullOrEmpty(path))
{
UnityUtil.LogError("Empty event path!");
return(null);
}
if (this.eventDescriptions.ContainsKey(path))
{
FMOD_StudioSystem.ERRCHECK(this.eventDescriptions[path].createInstance(out eventInstance));
}
else
{
EventDescription eventDescription = null;
FMOD_StudioSystem.ERRCHECK(this.system.getEvent(path, out eventDescription));
if (eventDescription != null && eventDescription.isValid())
{
this.eventDescriptions.Add(path, eventDescription);
FMOD_StudioSystem.ERRCHECK(eventDescription.createInstance(out eventInstance));
}
}
if (eventInstance == null)
{
UnityUtil.Log("GetEvent FAILED: \"" + path + "\"");
}
return(eventInstance);
}