//students join classrooms public void JoinRoom(TeacherRoot tl, StudentRoot sl, int sn, int cn) { teacherList = tl; studentList = sl; studentNumber = sn; classNumber = cn; Debug.Log("joining room: " + teacherList.teachers[classNumber].subject); debugText.text += "joining room: " + teacherList.teachers[classNumber].subject + "\n"; roomName = teacherList.teachers[classNumber].subject; PhotonNetwork.JoinRoom(roomName); }
private void Start() { mainPanel.SetActive(true); teacherPanel.SetActive(false); studentPanel.SetActive(false); //download JSON from API here StartCoroutine(DownloadJSON.DownloadJSONFiles()); //process hardcoded JSON files and create lists of teachers and students TextAsset jsonTeacher = Resources.Load <TextAsset>("teachers"); teacherList = JsonUtility.FromJson <TeacherRoot>(jsonTeacher.text); TextAsset jsonStudent = Resources.Load <TextAsset>("students"); studentList = JsonUtility.FromJson <StudentRoot>(jsonStudent.text); foreach (var s in studentList.students) { s.Initialize(); //set the student avatar color (from Hex value) } }