void Update() { if (clientLobby == null) { clientLobby = GameObject.Find("LobbyClient").GetComponent <LobbyClient>(); } else { GetPlayerIndex(clientLobby.GetPlayerID()); } }
void Start() { lobbyClient = GameObject.Find("LobbyClient").GetComponent <LobbyClient>(); playerNumber.GetComponent <SpriteRenderer>().sprite = playerNumberSprite[lobbyClient.GetPlayerID()]; characterFace.GetComponent <SpriteRenderer>().sprite = characterFaceSprite[(int)lobbyClient.myCharacter]; characterName.GetComponent <SpriteRenderer>().sprite = characterNameSprite[(int)lobbyClient.myCharacter]; stickCoreCenter = characterFace.transform.position; myScore = 0; myScoreLabel.text = "" + 0; switch (lobbyClient.GetPlayerID()) { case 0: playerColor = new Color(1.0f, 0.08f, 0.08f, 1.0f); // Red break; case 1: playerColor = new Color(1.0f, 0.65f, 0.0f, 1.0f); // Orange break; case 2: playerColor = new Color(1.0f, 0.93f, 0.0f, 1.0f); // Yellow break; case 3: playerColor = new Color(0.27f, 0.95f, 1.0f, 1.0f); // Blue break; case 4: playerColor = new Color(0.85f, 0.19f, 1.0f, 1.0f); // Violet break; case 5: playerColor = new Color(1.0f, 1.0f, 1.0f, 1.0f); // White break; } myScoreLabel.color = playerColor; }