void initializeObj() { ChangeActiveScreen(0); foreach (CourseList cl in data.list) { GameObject c = Instantiate(coursePrefabs, courseParent); c.GetComponent <Button>().onClick.AddListener(() => { if (inProgress) { return; } GenerateLesson(cl.dataRef); Menu2.GetComponent <RawImage>().color = cl.colorbg; learnscreen.GetComponent <RawImage>().color = cl.colorbg; sound.PlaySound("Klik"); HideMenu(); }); c.transform.GetChild(1).GetComponent <Text>().text = cl.courseName; c.GetComponent <RawImage>().texture = cl.texture; } }
public void setWinner() { Debug.Log("Player ke " + currentPlayer + "Winning The Game"); sound.PlaySound("TepukTangan"); players.Sort((b, a) => a.GetComponent <Player>().GetCurrentPos().CompareTo(b.GetComponent <Player>().GetCurrentPos())); int loop = players.Count >= 3 ? 3 : players.Count; for (int i = 0; i < loop; i++) { podium.GetChild(i).GetComponent <UnityEngine.UI.Text>().text = "Player - " + players[i].GetComponent <Player>().id.ToString(); } SetActiveResult(); }