public void BackButtonPressed() { // Oops, let's reset the match ID networkedPScript.CmdResetMatchSongID(); List <CaptainsMessPlayer> players = networkedPScript.GetPlayers(); int size = players.Count; foreach (CaptainsMessPlayer player in players) { NetworkedPlayerScript nps = player.GetComponent <NetworkedPlayerScript>(); if (!nps.isLocalPlayer) { nps.playerButton.SetActive(true); nps.playerButton.GetComponent <Button>().interactable = true; Vector3 goal = player.GetComponent <RemotePlayerScript>().GetPosition(); nps.playerButton.transform.DOLocalMove(goal, nps.fastMovementSpeed); nps.playerButton.transform.DOScale(Vector3.one, nps.fastMovementSpeed); } else { nps.playerParent.GetComponent <RectTransform>().sizeDelta = new Vector2(160 * (size + 1), 340); } } GUIManagerScript.SetBackButton(false); }
public void BackButtonPressed() { // Oops, let's reset the match ID networkedPScript.CmdResetMatchSongID(); GUIManagerScript.NumberInputLocked(false); List <CaptainsMessPlayer> players = networkedPScript.GetPlayers(); int size = players.Count; foreach (CaptainsMessPlayer player in players) { NetworkedPlayerScript nps = player.GetComponent <NetworkedPlayerScript>(); if (!nps.isLocalPlayer) { nps.playerButton.SetActive(true); nps.playerButton.GetComponent <Button>().interactable = true; Vector3 goal = player.GetComponent <RemotePlayerScript>().GetPosition(); nps.playerButton.transform.DOLocalMove(goal, nps.fastMovementSpeed); nps.playerButton.transform.DOScale(Vector3.one, nps.fastMovementSpeed); } else { nps.playerParent.GetComponent <RectTransform>().sizeDelta = new Vector2(160 * (size + 1), 340); } } // Optional clear colors after backing out of choice? /*Color clr = ColorScript.GetColor(networkedPScript.GetColor()); * clr = clr * 0.5f; * GUIManagerScript.SetNumberInputFieldColor(clr); * GUIManagerScript.ClearNumberInput();*/ GUIManagerScript.SetBackButton(false); }