//Start is called before the first frame update //It gets all the unity objects needed on this script, makes the infoLog invisible //Get an instance of the server connection //set the button events //Executes the function to connect to the server for the first time void Start() { GameObject infoLogObject = GameObject.Find("InfoLog"); infoLogObject.GetComponent <Canvas>().enabled = false; infoLogAnimator = infoLogObject.GetComponent <Animator>(); GameObject loginWindow = GameObject.Find("LoginWindow"); loginLogic = loginWindow.GetComponent <LoginLogic>(); GameObject informationWindow = GameObject.Find("InformationWindow"); informationLogic = informationWindow.GetComponent <InformationLogic>(); GameObject registerWindow = GameObject.Find("RegisterWindow"); registerLogin = registerWindow.GetComponent <RegisterLogin>(); GameObject mainMenuWindow = GameObject.Find("MainMenuWindow"); mainMenuLogic = mainMenuWindow.GetComponent <MainMenuLogic>(); GameObject gameCreationWindow = GameObject.Find("GameCreationWindow"); gameCreationLogic = gameCreationWindow.GetComponent <GameCreationLogic>(); GameObject invitationWindow = GameObject.Find("InvitationWindow"); invitationLogic = invitationWindow.GetComponent <InvitationLogic>(); GameObject joinAGameWindow = GameObject.Find("JoinAGameWindow"); joinAGameLogic = joinAGameWindow.GetComponent <JoinAGameLogic>(); GameObject scoreBoardWindow = GameObject.Find("ScoreboardWindow"); scoreBoardLogic = scoreBoardWindow.GetComponent <ScoreBoardLogic>(); connectToServer(); }
public void OnScoreLost() { var logic = new ScoreBoardLogic(yourScore, opponentScore, centerMessage); logic.OnScore(PlayerScore.WinningScore, false); StringAssert.Contains(PlayerScore.WinningScore.ToString(), opponentScore.text); StringAssert.Contains("LOSE", centerMessage.text); }
public void OnScoreWon() { var logic = new ScoreBoardLogic(yourScore, opponentScore, centerMessage); logic.OnScore(PlayerScore.WinningScore, true); StringAssert.Contains(PlayerScore.WinningScore.ToString(), yourScore.text); StringAssert.Contains("WIN", centerMessage.text); }
public void OnScoreNotWonOrLost() { var logic = new ScoreBoardLogic(yourScore, opponentScore, centerMessage); for (var i = 0; i <= 1; i++) { for (var y = 0; y < PlayerScore.WinningScore; y++) { var isPlayerLocal = i == 0; logic.OnScore(y, isPlayerLocal); var check = isPlayerLocal ? yourScore : opponentScore; Assert.AreEqual(centerMessage.text, ""); StringAssert.Contains(y.ToString(), check.text); } } }
//Start is called before the first frame update //It gets all the unity objects needed on this script, makes the infoLog invisible //Get an instance of the server connection //set the button events //Executes the function to connect to the server for the first time void OnSceneLoaded(Scene scene, LoadSceneMode mode) { Debug.Log("Loading Message_Parser"); GameObject infoLogObject = GameObject.Find("InfoLog"); infoLogObject.GetComponent <Canvas>().enabled = false; infoLogAnimator = infoLogObject.GetComponent <Animator>(); GameObject loginWindow = GameObject.Find("LoginWindow"); loginLogic = loginWindow.GetComponent <LoginLogic>(); GameObject informationWindow = GameObject.Find("InformationWindow"); informationLogic = informationWindow.GetComponent <InformationLogic>(); GameObject registerWindow = GameObject.Find("RegisterWindow"); registerLogin = registerWindow.GetComponent <RegisterLogin>(); GameObject mainMenuWindow = GameObject.Find("MainMenuWindow"); mainMenuLogic = mainMenuWindow.GetComponent <MainMenuLogic>(); GameObject gameCreationWindow = GameObject.Find("GameCreationWindow"); gameCreationLogic = gameCreationWindow.GetComponent <GameCreationLogic>(); GameObject invitationWindow = GameObject.Find("InvitationWindow"); invitationLogic = invitationWindow.GetComponent <InvitationLogic>(); GameObject joinAGameWindow = GameObject.Find("JoinAGameWindow"); joinAGameLogic = joinAGameWindow.GetComponent <JoinAGameLogic>(); GameObject scoreboardWindow = GameObject.Find("ScoreboardWindow"); scoreBoardLogic = scoreboardWindow.GetComponent <ScoreBoardLogic>(); GameObject personalBoardWindow = GameObject.Find("PersonalBoardWindow"); personalBoardLogic = personalBoardWindow.GetComponent <LoginUI.PersonalBoardLogic>(); connectToServer(); }