Exemplo n.º 1
0
        public void AddExposedParameter(AudioParameterPath path)
        {
            if (!ContainsExposedParameter(path.parameter))
            {
                List <ExposedAudioParameter> parameters = new List <ExposedAudioParameter>(exposedParameters);
                ExposedAudioParameter        newParam   = new ExposedAudioParameter();
                newParam.name = FindUniqueParameterName("MyExposedParam", exposedParameters);
                newParam.guid = path.parameter;
                parameters.Add(newParam);

                // We sort the exposed params by path
                parameters.Sort(SortFuncForExposedParameters);

                exposedParameters = parameters.ToArray();
                OnChangedExposedParameter();

                //Cache the path!
                exposedParamCache[path.parameter] = path;

                AudioMixerUtility.RepaintAudioMixerAndInspectors();
            }
            else
            {
                Debug.LogError("Cannot expose the same parameter more than once!");
            }
        }
Exemplo n.º 2
0
        public void RemoveExposedParameter(GUID parameter)
        {
            exposedParameters = exposedParameters.Where(val => val.guid != parameter).ToArray();
            OnChangedExposedParameter();

            //Tidy up the cache..
            if (exposedParamCache.ContainsKey(parameter))
            {
                exposedParamCache.Remove(parameter);
            }

            AudioMixerUtility.RepaintAudioMixerAndInspectors();
        }
Exemplo n.º 3
0
        public void AddExposedParameter(AudioParameterPath path)
        {
            if (path == null)
            {
                Debug.LogError("Trying to expose null parameter.");
                return;
            }

            if (path.parameter == default)
            {
                Debug.LogError("Trying to expose parameter with default GUID.");
                return;
            }

            if (ContainsExposedParameter(path.parameter))
            {
                Debug.LogError("Cannot expose the same parameter more than once.");
                return;
            }

            var parameters = new List <ExposedAudioParameter>(exposedParameters);
            var newParam   = new ExposedAudioParameter();

            newParam.name = FindUniqueParameterName("MyExposedParam", exposedParameters);
            newParam.guid = path.parameter;
            parameters.Add(newParam);

            // We sort the exposed params by path
            parameters.Sort(SortFuncForExposedParameters);

            exposedParameters = parameters.ToArray();
            OnChangedExposedParameter();

            //Cache the path!
            exposedParamCache[path.parameter] = path;

            AudioMixerUtility.RepaintAudioMixerAndInspectors();
        }