/// <summary> /// Called when the log in button is pressed /// </summary> public void StudentLogIn() { string name = nameInputField.text; int pinCode = int.Parse(pinCodeInputField.text); DBConnector.GetUserData((callback) => { if (callback == null) // Incorrect login detected { PrintError("Oeps, dat klopt niet", Color.red); } else { foreach (object student in callback) { // Correct login detected, set current student Student.currentStudent = (Student)student; nameInputField.text = ""; pinCodeInputField.text = ""; PrintError("", Color.black); panelHandler.SwitchPanel(Panel.Level.ToString()); SetLoadingSymbolActive(false); } } }, isTeacher: false, studentName: name, studentPin: pinCode); }
public void OpenScenario(GameObject hiddenId) { panelHandler.SwitchPanel("CreateScenario"); translator.LoadScenarioDetails(hiddenId.GetComponent <Text>()); }