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; } } }
private static void CollectParameterUpdaters() { foreach (Type currentDomainType in App.GetCurrentDomainTypes()) { if (!currentDomainType.IsAbstract) { bool flag = false; for (Type baseType = currentDomainType.BaseType; baseType != null; baseType = baseType.BaseType) { if (baseType == typeof(OneShotSoundParameterUpdater)) { flag = true; break; } } if (flag) { OneShotSoundParameterUpdater oneShotSoundParameterUpdater = (OneShotSoundParameterUpdater)Activator.CreateInstance(currentDomainType); DebugUtil.Assert(!parameterUpdaters.ContainsKey(oneShotSoundParameterUpdater.parameter)); parameterUpdaters[oneShotSoundParameterUpdater.parameter] = oneShotSoundParameterUpdater; } } } }