Ejemplo n.º 1
0
    private void StartPlay()
    {
        if (isPlaying)
        {
            // pause
            curPlayer.Pause();
            isPlaying = false;
            SwapTex();
        }
        else if (curPlayer != null)
        {
            // unpause
            curPlayer.Play();
            SwapTex();
            isPlaying = true;
        }
        else
        {
            // try to start new playback
            if (isRecording)
            {
                recordButton.Record();
            }

            StartCoroutine(Player());
        }
    }