public void RpcCountdown(bool l) { GUIManagerScript.SetEndGameScreen(false); if (l) { //playerParent.GetComponent<PlayerParentScript>().LockAndSpin(); AudioManagerScript.instance.PrepareGameMusic(); AudioManagerScript.instance.PlayCountdown(); GUIManagerScript.SetRulesButton(false); GUIManagerScript.SetInput(false); } else { //playerParent.GetComponent<PlayerParentScript>().Unlock(); Debug.Log("Countdown stopped!"); AudioManagerScript.instance.StopSFX(); AudioManagerScript.instance.StartMenuMusic(); GUIManagerScript.SetRulesButton(true); GUIManagerScript.SetInput(true); if (networkedPScript == null) { SetNPS(); } if (networkedPScript.nameText == ColorScript.GetColorName(networkedPScript.GetColor())) { networkedPScript.nameText = ""; GUIManagerScript.FillPlayerText(""); } } }
public void RpcStartGame(int s) { songID = s; scored_ThisRound = 0; scored_TimeBonus = 0; scored_FirstBonus = false; scored_WasGuessed = false; //playerParent.GetComponent<PlayerParentScript>().Unlock(); // Bullshit code. Temp? Maybe not? // What if player WAS ready, but now that we're actually starting they are no longer? // Too late for them! Let's double check if (!ready) { Assert.IsFalse(ready, "Player wasn't ready, but the server thought they were!"); // Oh noes! What do we do? Let's cheat: SetReady(true); // See buddy, you were ready the whole time, right? } ResetMatch(); if (isLocalPlayer) { GUIManagerScript.FillPlayerText(nameText); GUIManagerScript.SetButton(false); GUIManagerScript.DisableInput(true); GUIManagerScript.SetBackButton(false); AudioManagerScript.instance.StartGameMusic(); GUIManagerScript.SetColorShow(nameText, ColorScript.GetColor(color), ColorScript.GetColorName(color)); localPScript.reminded = false; } List <CaptainsMessPlayer> players = GetPlayers(); foreach (CaptainsMessPlayer player in players) { NetworkedPlayerScript nps = player.GetComponent <NetworkedPlayerScript>(); if (!nps.isLocalPlayer) { player.GetComponent <NetworkedPlayerScript>().playerButton.SetActive(true); player.GetComponent <NetworkedPlayerScript>().playerButton.GetComponent <Button>().interactable = true; } } }
public void OnNameTextChanged(string s) { if (s == "") { nameText = ColorScript.GetColorName(color); } else { nameText = s; } playerButton.GetComponentInChildren <Text>().text = nameText; to_sort = true; }
void RpcSetColor(int c) { color = c; to_sort = true; SetColor(); if (isLocalPlayer) { string clr_name = ColorScript.GetColorName(c); Color clr = ColorScript.GetColor(c); GUIManagerScript.SetInputColor(clr, clr_name); clr = clr * 0.5f; GUIManagerScript.SetBGColor(clr); GUIManagerScript.FillPlayerNumber(c); GUIManagerScript.SetNumberInputFieldColor(clr); GUIManagerScript.ClearNumberInput(); } }
void RpcSetColor(int c) { int oldColor = color; color = c; SetColor(); string clr_name = ColorScript.GetColorName(c); if (isLocalPlayer) { Color clr = ColorScript.GetColor(c); GUIManagerScript.SetInputColor(clr, clr_name); clr = clr * 0.5f; GUIManagerScript.SetBGColor(clr); } if (nameText == ColorScript.GetColorName(oldColor) || nameText == "") { OnNameTextChanged(clr_name); } }
public void RpcStartGame(int s) { songID = s; scored_ThisRound = 0; scored_TimeBonus = 0; scored_FirstBonus = false; scored_WasGuessed = false; //playerParent.GetComponent<PlayerParentScript>().Unlock(); // Bullshit code. Temp? Maybe not? // What if player WAS ready, but now that we're actually starting they are no longer? // Too late for them! Let's double check if (!ready) { Assert.IsFalse(ready, "Player wasn't ready, but the server thought they were!"); // Oh noes! What do we do? Let's cheat: SetReady(true); // See buddy, you were ready the whole time, right? } ResetMatch(); if (isLocalPlayer) { GUIManagerScript.SetButton(false); GUIManagerScript.SetBackButton(false); Color clr = ColorScript.GetColor(GetColor()); clr = clr * 0.5f; GUIManagerScript.SetNumberInputFieldColor(clr); GUIManagerScript.ClearNumberInput(); GUIManagerScript.SetSongSetButton(false); //Hacky bullshit for finding which kind of game we're in? GameManagerScript gameManager = FindObjectOfType <GameManagerScript>(); Assert.IsNotNull <GameManagerScript>(gameManager); int index = gameManager.GetSongSet(); AudioManagerScript.instance.StartGameMusic(index); GUIManagerScript.SetClassicGameParent(color, ColorScript.GetColor(color), ColorScript.GetColorName(color)); localPScript.reminded = false; } List <CaptainsMessPlayer> players = GetPlayers(); foreach (CaptainsMessPlayer player in players) { NetworkedPlayerScript nps = player.GetComponent <NetworkedPlayerScript>(); if (!nps.isLocalPlayer) { player.GetComponent <NetworkedPlayerScript>().playerButton.SetActive(true); player.GetComponent <NetworkedPlayerScript>().playerButton.GetComponent <Button>().interactable = true; } } }