// Start is called before the first frame update void Start() { pd = GetComponent <Hv_finalfinalsong_AudioLib>(); pd.FillTableWithFloatBuffer("strings", new float[] { 1, 40, 45, 50, 55, 59, 64 }); pd.FillTableWithFloatBuffer("notes", new float[] { 0, 8, 2, 4, 5, 7, 9, 11, 12 }); pd.FillTableWithFloatBuffer("bass", new float[] { 0, 300, 0, 300, 0, 201, 0, 203, 0, 203, 0, 300, 0 }); pd.FillTableWithFloatBuffer("percussion", new float[] { 0, 300, 0, 300, 0, 201, 0, 203, 0, 203, 0, 300, 0 }); pd.FillTableWithFloatBuffer("melody", new float[] { 0, 402, 501, 503, 503, 503, 600, 601, 601, 603, 600, 603 }); pd.SendEvent(Hv_finalfinalsong_AudioLib.Event.Bang); pd.SetFloatParameter(Hv_finalfinalsong_AudioLib.Parameter.Freq, 418); var comps = goodShip.GetComponentsInChildren <CannonScript>(); foreach (var cmp in comps) { cmp.enabled = false; Debug.Log("SET FALSE"); } }
public override void OnInspectorGUI() { bool isEnabled = _dsp.IsInstantiated(); if (!isEnabled) { EditorGUILayout.LabelField("Press Play!", EditorStyles.centeredGreyMiniLabel); } GUILayout.BeginVertical(); // EVENTS GUI.enabled = isEnabled; EditorGUILayout.Space(); // bang if (GUILayout.Button("bang")) { _dsp.SendEvent(Hv_finalfinalsong_AudioLib.Event.Bang); } // PARAMETERS GUI.enabled = true; EditorGUILayout.Space(); EditorGUI.indentLevel++; // freq GUILayout.BeginHorizontal(); float freq = _dsp.GetFloatParameter(Hv_finalfinalsong_AudioLib.Parameter.Freq); float newFreq = EditorGUILayout.Slider("freq", freq, 0.0f, 2000.0f); if (freq != newFreq) { _dsp.SetFloatParameter(Hv_finalfinalsong_AudioLib.Parameter.Freq, newFreq); } GUILayout.EndHorizontal(); EditorGUI.indentLevel--; GUILayout.EndVertical(); }