REST Web Service in Unity
•
PlayerScoreManager.cs
/
/Scores label
GameObject scoreLabel = new GameObject();
scoreLabel.name = "PlayerInfoNameLabel";
scoreLabel.transform.SetParent(canvas.transform);
text = scoreLabel.AddComponent<Text>();
text.text = "Score";
text.font = font;
text.fontStyle = FontStyle.Bold;
text.rectTransform.anchoredPosition = new Vector3(130, (maxPlayers *
3
0) - ((maxPlayers / 2) * 30), 0);
for (int i = 0; i < maxPlayers; i++){
/
/Name label
playerLabelsNames[i] = new GameObject();
playerLabelsNames[i].name = "PlayerInfoName" + i;
playerLabelsNames[i].transform.SetParent(canvas.transform);
text = playerLabelsNames[i].AddComponent<Text>();
text.text = "";
text.font = font;
text.rectTransform.anchoredPosition = new Vector3(-80, (i * 30) –
(
(maxPlayers / 2) * 30), 0);