Exemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (!isRecording)
        {
            if (startRecordingQueued)
            {
                if (AudioSettings.dspTime <= startRecordingDSPTime)
                {
                    isRecording          = true;
                    startRecordingQueued = false;
                }
            }
            else
            {
                if (Input.GetKeyDown("space"))
                {
                    StartRecording();
                }
            }

            if (Input.GetKeyDown("1"))
            {
                selectedLoop = 0;
            }
            if (Input.GetKeyDown("2"))
            {
                selectedLoop = 1;
            }
            if (Input.GetKeyDown("3"))
            {
                selectedLoop = 2;
            }
            if (Input.GetKeyDown("4"))
            {
                selectedLoop = 3;
            }
        }
        else
        {
            if (AudioSettings.dspTime >= startRecordingDSPTime + SongController.GetMeasureLength() - SongController.GetBeatLength() / 4)
            {
                StopRecording();
            }
        }
    }