public void Cancel() { if (state == PlayerSelectorState.Joined) { if (joinedCancelSound != null) { joinedCancelSound.PlayEffect(); } state = PlayerSelectorState.NameEntry; nameEntry.gameObject.SetActive(true); nameEntry.DisplayTextEntry(); readyText.SetActive(false); if (playerStatus != null) { playerStatus.text = "A: Confirm B: Cancel\r\nY: Random Name"; } Globals.Instance.GameManager.RemovePlayer(pInfo); } else if (state == PlayerSelectorState.NameEntry) { if (cancelSound != null) { cancelSound.PlayEffect(); } Reset(); } }
public void Reset() { playerStatus.text = "Press A to join!"; state = PlayerSelectorState.Unjoined; nameEntry.gameObject.SetActive(false); readyText.SetActive(false); Globals.Instance.GameManager.RemovePlayer(pInfo); pInfo.playerNum = playerNum; pInfo.name = nameEntry.GetName(); pInfo.roundsWon = 0; }
public void Confirm() { if (state == PlayerSelectorState.Unjoined) { if (confirmSound != null) { confirmSound.PlayEffect(); } state = PlayerSelectorState.NameEntry; nameEntry.gameObject.SetActive(true); nameEntry.DisplayTextEntry(); if (playerStatus != null) { playerStatus.text = "A: Confirm B: Cancel\r\nY: Random Name"; } } else if (state == PlayerSelectorState.NameEntry) { if (joinedConfirmSound != null) { joinedConfirmSound.PlayEffect(); } state = PlayerSelectorState.Joined; nameEntry.DisplayName(); readyText.SetActive(true); pInfo.name = nameEntry.GetName(); Globals.Instance.GameManager.AddPlayer(pInfo); if (playerStatus != null) { playerStatus.text = "Joined!\r\nPress B to cancel..."; } } }