Example #1
0
 private static void CollectSoundDescriptions()
 {
     Bank[] array = null;
     RuntimeManager.StudioSystem.getBankList(out array);
     Bank[] array2 = array;
     for (int i = 0; i < array2.Length; i++)
     {
         Bank bank = array2[i];
         bank.getEventList(out EventDescription[] array3);
         for (int j = 0; j < array3.Length; j++)
         {
             EventDescription eventDescription = array3[j];
             eventDescription.getPath(out string path);
             HashedString     key   = path;
             SoundDescription value = default(SoundDescription);
             value.path = path;
             float distance = 0f;
             eventDescription.getMaximumDistance(out distance);
             if (distance == 0f)
             {
                 distance = 60f;
             }
             value.falloffDistanceSq = distance * distance;
             List <OneShotSoundParameterUpdater> list = new List <OneShotSoundParameterUpdater>();
             int count = 0;
             eventDescription.getParameterCount(out count);
             SoundDescription.Parameter[] array4 = new SoundDescription.Parameter[count];
             for (int k = 0; k < count; k++)
             {
                 eventDescription.getParameterByIndex(k, out PARAMETER_DESCRIPTION parameter);
                 string text = parameter.name;
                 array4[k] = new SoundDescription.Parameter
                 {
                     name = new HashedString(text),
                     idx  = k
                 };
                 OneShotSoundParameterUpdater value2 = null;
                 if (parameterUpdaters.TryGetValue(text, out value2))
                 {
                     list.Add(value2);
                 }
             }
             value.parameters = array4;
             value.oneShotParameterUpdaters = list.ToArray();
             soundDescriptions[key]         = value;
         }
     }
 }
Example #2
0
    public static int FindParameterIndex(EventDescription eventDescription, string parameterName)
    {
        int num = 0;

        UnityUtil.ERRCHECK(eventDescription.getParameterCount(out num));
        for (int i = 0; i < num; i++)
        {
            PARAMETER_DESCRIPTION parameter_DESCRIPTION;
            UnityUtil.ERRCHECK(eventDescription.getParameterByIndex(i, out parameter_DESCRIPTION));
            if (parameter_DESCRIPTION.name == parameterName)
            {
                return(i);
            }
        }
        return(-1);
    }
Example #3
0
    private static int GetParameterIndex(string eventPath, string parameterName)
    {
        EventDescription eventDescription = FMOD_StudioSystem.instance.GetEventDescription(eventPath, true);

        if (eventDescription != null)
        {
            int num;
            UnityUtil.ERRCHECK(eventDescription.getParameterCount(out num));
            for (int i = 0; i < num; i++)
            {
                PARAMETER_DESCRIPTION parameter_DESCRIPTION;
                UnityUtil.ERRCHECK(eventDescription.getParameterByIndex(i, out parameter_DESCRIPTION));
                if (parameter_DESCRIPTION.name == parameterName)
                {
                    return(i);
                }
            }
        }
        return(-1);
    }