Example #1
0
    /// <summary>
    /// Gets the event.
    /// </summary>
    /// <param name="path">The path.</param>
    /// <returns></returns>
    public FMOD.Studio.EventInstance GetEvent(string path)
    {
        FMOD.Studio.EventInstance instance = null;

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

        if (eventDescriptions.ContainsKey(path))
        {
            Logger.ErrorCheck(eventDescriptions[path].CreateInstance(out instance));
        }
        else
        {
            FMOD.Studio.EventDescription desc = GetEventDescription(path);
            Logger.ErrorCheck(desc.CreateInstance(out instance));
        }

        if (instance == null)
        {
            Logger.LogMessage("GetEvent Failed: \"path\"");
        }

        return(instance);
    }
Example #2
0
    /// <summary>
    /// Gets the event.
    /// </summary>
    /// <param name="eventDescription">The event description.</param>
    /// <returns></returns>
    public FMOD.Studio.EventInstance GetEvent(FMOD.Studio.EventDescription eventDescription)
    {
        FMOD.Studio.EventInstance instance = null;

        Logger.ErrorCheck(eventDescription.CreateInstance(out instance));

        if (instance == null)
        {
            Logger.LogMessage("GetEvent Failed: \"path\"");
        }

        return(instance);
    }