public void SetWaveType(WaveType newWaveType) { waveType = newWaveType; switch (waveType) { case WaveType.Sine: function = Sine; break; case WaveType.Rect: function = Rect; break; case WaveType.Sawtooth: function = Sawt; break; case WaveType.Triangle: function = Tria; break; case WaveType.Custom: function = Cust; break; } OnFreqChange.Invoke(Freq); }
public void SetWaveType(WaveType newWaveType) { if (setTranstion) { return; } waveType = newWaveType; switch (waveType) { case WaveType.Sine: newWaveFunc = Sine; break; case WaveType.Rect: newWaveFunc = Rect; break; case WaveType.Sawtooth: newWaveFunc = Sawt; break; case WaveType.Triangle: newWaveFunc = Tria; break; case WaveType.Custom: newWaveFunc = Cust; break; } setTranstion = true; OnFreqChange.Invoke(_Freq); }