コード例 #1
0
    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);
    }
コード例 #2
0
    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);
    }