public WinHandlerFunctor(string name, List <ShipMotor> motors, WinnerPanel winPanel, int pointsToWin) { this.name = name; this.motors = motors; this.winPanel = winPanel; this.pointsToWin = pointsToWin; }
public WinHandlerFunctor(string name, List<ShipMotor> motors, WinnerPanel winPanel, int pointsToWin) { this.name = name; this.motors = motors; this.winPanel = winPanel; this.pointsToWin = pointsToWin; }
public void StartGame(int Mode) { StartGameMenu.SetActive(false); GameUIPanel.SetActive(true); WinnerPanel.SetActive(false); InfoPanel.SetActive(true); Main.HideBackgroundElements(); switch (Mode) { case 1: Player2CtrlPanel.SetActive(false); break; case 2: Player2CtrlPanel.SetActive(true); break; case 3: Player2CtrlPanel.SetActive(false); break; } MenuCam.CameraMode = 2; GameMode = Mode; GameStartBtnPressed = true; }
// Use this for initialization void Start() { S = this; winningPlayerText = transform.Find("WinnerText").GetComponent <Text>(); titleText = transform.Find("WinnerTitleText").GetComponent <Text>(); championText = transform.Find("ChampionText").GetComponent <Text>(); pressStartText = transform.Find("PressStartText").GetComponent <Text>(); roundWonText = transform.Find("RoundWonText").GetComponent <Text>(); }
public void BackToMainMenu() { ScorePanel.SetActive(false); InfoPanel.SetActive(false); WinnerPanel.SetActive(false); PausePanel.SetActive(false); MenuCam.CameraMode = 1; OpenMainMenu(); Main.PrepareBackground(); }
public static WinnerPanel GetInstance() { if (!instance) { instance = GameObject.Find("Canvas").transform.Find("WinnerPanel").GetComponent <WinnerPanel>(); if (!instance) { Debug.LogError("There needs to be one active MyClass script on a GameObject in your scene."); } } return(instance); }
public void ShowWinnerPanel(int Player, int Score) { if (Player == 1 || Player == 2) { WinnerText.text = "PLAYER " + Player + " WINS!"; } else if (Player == 3) { WinnerText.text = "SCORE: " + Score; } WinnerPanel.SetActive(true); Winner = true; GameStartBtnPressed = false; GameStarted = false; }
private void Awake() { Instance = this; }
void ShowWinnerPanel() { GetComponent <AudioSource>().PlayOneShot(gameEndSound); WinnerPanel.GetInstance().SetWinner(score1, score2); WinnerPanel.GetInstance().Show(); }
// Start is called before the first frame update void Start() { this._textUI = this.GetComponent <Text>(); this.scoreManager = GameObject.FindWithTag("ScoreManager").GetComponent <ScoreManager>(); this.winnerPanel = GameObject.FindWithTag("WinnerPanel").GetComponent <WinnerPanel>(); }
// Update is called once per frame void Update() { if (GameStartBtnPressed && !Winner) { if (Input.GetKeyDown(KeyCode.Return)) { InfoPanel.SetActive(false); ScorePanel.SetActive(true); Main.StartGame(GameMode); if (GameMode == 1 || GameMode == 2) { Player2Score.SetActive(true); } else if (GameMode == 3) { Player2Score.SetActive(false); } GameStartBtnPressed = false; GamePaused = false; GameStarted = true; } if (Input.GetKey(KeyCode.Escape)) { GameStartBtnPressed = false; Winner = false; BackToMainMenu(); } } if (GameStarted && !GamePaused) { if (Input.GetKeyDown(KeyCode.Escape)) { GamePaused = true; PausePanelCtrl(GamePaused); Time.timeScale = 0; } } if (GamePaused) { if (Input.GetKeyDown(KeyCode.Return)) { GamePaused = false; PausePanelCtrl(GamePaused); Time.timeScale = 1; } if (Input.GetKeyDown(KeyCode.Space)) { GamePaused = false; GameStarted = false; PausePanelCtrl(GamePaused); Time.timeScale = 1; BackToMainMenu(); } } if (Winner) { if (Input.GetKeyDown(KeyCode.Return)) { WinnerPanel.SetActive(false); Main.StartGame(GameMode); GameStarted = true; Winner = false; } if (Input.GetKeyDown(KeyCode.Escape)) { WinnerPanel.SetActive(false); GameStarted = false; Winner = false; MenuCam.CameraMode = 1; BackToMainMenu(); } } }