예제 #1
0
    public List <FmodEvent> loadEventsFromFile(string assetPath, string assetName, FmodEventAsset asset)
    {
        FMOD.EventGroup       eventgroup  = null;
        FMOD.RESULT           result      = FMOD.RESULT.OK;
        List <FmodEvent>      events      = new List <FmodEvent>();
        List <FmodEventGroup> eventGroups = new List <FmodEventGroup>();
        int            numGroups          = 0;
        FmodEventGroup toAdd = null;

        FMOD.EVENT_LOADINFO loadInfo = new FMOD.EVENT_LOADINFO();
        FMOD.EventProject   project  = null;

        _loadFile(assetPath, assetName, ref loadInfo, ref project);
        _getSoundBankNames(asset);

        FMOD.EVENT_PROJECTINFO projectInfo = new FMOD.EVENT_PROJECTINFO();
        project.getInfo(ref projectInfo);
        asset.setProjectName(new string(projectInfo.name));

        result = project.getNumGroups(ref numGroups);
        ERRCHECK(result);
        for (int i = 0; i < numGroups; i++)
        {
            result = project.getGroupByIndex(i, false, ref eventgroup);
            ERRCHECK(result);
            toAdd = FmodEventGroup.CreateInstance("FmodEventGroup") as FmodEventGroup;
            toAdd.Initialize(eventgroup, null, asset);
            eventGroups.Add(toAdd);
            events.AddRange(toAdd.getAllEvents());
        }
        asset.setEventGroups(eventGroups);
        loadReverbsFromFile(asset);
        return(events);
    }
예제 #2
0
 public void releaseAllEventsFromGroup(FmodEventGroup grp)
 {
     if (grp != null)
     {
         foreach (FmodEvent evt in grp.getAllEvents())
         {
             if (m_eventPoolManager.eventPoolExists(evt))
             {
                 m_eventPoolManager.getEventPool(evt).releaseAllHandles();
             }
         }
     }
 }
예제 #3
0
    public int getNumberRunningInstancesInGroup(FmodEventGroup grp)
    {
        if (grp == null)
        {
            return(0);
        }
        int total = 0;

        foreach (FmodEvent evt in grp.getAllEvents())
        {
            if (m_eventPoolManager.eventPoolExists(evt))
            {
                total += m_eventPoolManager.getEventPool(evt).getNumberRunningInstances();
            }
        }
        return(total);
    }
예제 #4
0
 public void releaseAllEventsFromGroup(FmodEventGroup grp)
 {
     if (grp != null) {
         foreach (FmodEvent evt in grp.getAllEvents()) {
             if (m_eventPoolManager.eventPoolExists(evt)) {
                 m_eventPoolManager.getEventPool(evt).releaseAllHandles();
             }
         }
     }
 }
예제 #5
0
    public int getNumberRunningInstancesInGroup(FmodEventGroup grp)
    {
        if (grp == null) {
            return (0);
        }
        int total = 0;

        foreach (FmodEvent evt in grp.getAllEvents()) {
            if (m_eventPoolManager.eventPoolExists(evt)) {
                total += m_eventPoolManager.getEventPool(evt).getNumberRunningInstances();
            }
        }
        return (total);
    }