Wszystkie funkcjonalnosci git, potrzeba poprawy UI
This commit is contained in:
30
Assets/Scripts/InitialSceneScripts/MenuController.cs
Normal file
30
Assets/Scripts/InitialSceneScripts/MenuController.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
public class MenuController : MonoBehaviour
|
||||
{
|
||||
[Header("UI References")]
|
||||
public TMP_InputField subjectIdInput;
|
||||
|
||||
[Header("Scene Settings")]
|
||||
public string firstSceneName = "InstructionScene";
|
||||
|
||||
public void OnStartButtonClicked()
|
||||
{
|
||||
string subjectId = subjectIdInput.text.Trim();
|
||||
|
||||
// Fallback in case you forget to type an ID
|
||||
if (string.IsNullOrEmpty(subjectId))
|
||||
{
|
||||
subjectId = "Test_Subject_01";
|
||||
Debug.LogWarning("[MenuController] ID was empty. Using default ID.");
|
||||
}
|
||||
|
||||
// 1. Create folders and connect to MQTT
|
||||
ExperimentManager.Instance.InitializeSession(subjectId);
|
||||
|
||||
// 2. Load the next scene
|
||||
SceneManager.LoadScene(firstSceneName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user