using UnityEngine;
using UnityEngine.SceneManagement;

public class TaskButtonManager : MonoBehaviour
{
    private void Update()
    {
        // VR Tasks (Keys 1-4)
        if (Input.GetKeyDown(KeyCode.Alpha1) || Input.GetKeyDown(KeyCode.Keypad1))
            LoadSceneByName("VR-Task1");
        else if (Input.GetKeyDown(KeyCode.Alpha2) || Input.GetKeyDown(KeyCode.Keypad2))
            LoadSceneByName("VR -Task2");
        else if (Input.GetKeyDown(KeyCode.Alpha3) || Input.GetKeyDown(KeyCode.Keypad3))
            LoadSceneByName("VR -Task3");
        else if (Input.GetKeyDown(KeyCode.Alpha4) || Input.GetKeyDown(KeyCode.Keypad4))
            LoadSceneByName("VR -Task4");

        // AR Tasks (Keys 5-8)
        else if (Input.GetKeyDown(KeyCode.Alpha5) || Input.GetKeyDown(KeyCode.Keypad5))
            LoadSceneByName("AR-Task1");
        else if (Input.GetKeyDown(KeyCode.Alpha6) || Input.GetKeyDown(KeyCode.Keypad6))
            LoadSceneByName("AR-Task2");
        else if (Input.GetKeyDown(KeyCode.Alpha7) || Input.GetKeyDown(KeyCode.Keypad7))
            LoadSceneByName("AR-Task3");
        else if (Input.GetKeyDown(KeyCode.Alpha8) || Input.GetKeyDown(KeyCode.Keypad8))
            LoadSceneByName("AR-Task4");

        // Lobby (Key L or 0)
        else if (Input.GetKeyDown(KeyCode.L) || Input.GetKeyDown(KeyCode.Alpha0) || Input.GetKeyDown(KeyCode.Keypad0))
            LoadSceneByName("Lobby");
    }

    private void LoadSceneByName(string sceneName)
    {
        Debug.Log($"Loading scene: {sceneName}");
        SceneManager.LoadScene(sceneName);
    }
}
