Exemplo n.º 1
0
        /// <summary>
        /// EDITOR: Draw the parameters section of the event editor
        /// </summary>
        public void DrawParameters()
        {
            if (GUILayout.Button("Add Parameter"))
            {
                AddParameter();
            }

            if (this.parameters == null)
            {
                this.parameters = new List <AudioEventParameter>();
            }

            for (int i = 0; i < this.parameters.Count; i++)
            {
                AudioEventParameter tempParam = this.parameters[i];
                tempParam.parameter     = EditorGUILayout.ObjectField(tempParam.parameter, typeof(AudioParameter), false) as AudioParameter;
                tempParam.responseCurve = EditorGUILayout.CurveField("Curve", tempParam.responseCurve);
                tempParam.paramType     = (ParameterType)EditorGUILayout.EnumPopup("Property", tempParam.paramType);
                if (GUILayout.Button("Delete Parameter"))
                {
                    DeleteParameter(tempParam);
                }
                EditorGUILayout.Separator();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Internal AudioManager use: Sync changes to the parameters on all ActiveEvents
 /// </summary>
 private void UpdateParameters()
 {
     for (int i = 0; i < this.activeParameters.Length; i++)
     {
         AudioEventParameter tempParam = this.activeParameters[i].rootParameter;
         if (tempParam.CurrentValue != tempParam.parameter.CurrentValue)
         {
             tempParam.SyncParameter();
         }
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// EDITOR: Remove a parameter from the event
 /// </summary>
 /// <param name="parameterToDelete">The parameter you wish to remove</param>
 public void DeleteParameter(AudioEventParameter parameterToDelete)
 {
     this.parameters.Remove(parameterToDelete);
 }