protected override void PlayingNext() { if (foul == FoulEnum.Clear && shotScore != 0) { ActivePlayer.PlayerState = PlayerState.ActiveClear; } else { tempPlayer = PassivePlayer; PassivePlayer = ActivePlayer; ActivePlayer = tempPlayer; ((PlayerOnline)PassivePlayer).Active = false; ((PlayerOnline)ActivePlayer).Active = true; PassivePlayer.PlayerState = PlayerState.Passive; if (foul == FoulEnum.WhiteInHole) { ActivePlayer.PlayerState = PlayerState.ActiveWIH; } else { ActivePlayer.PlayerState = PlayerState.ActiveClear; } CurrentCameraPositionType = CurrentCameraPositionType; } }
// First thing called on game start void Awake() { galaxyManagerActive = false; shotsTaken = 0; fouls = 0; ballOn = BallColorEnum.Red; foul = FoulEnum.Clear; threshold = 0.001f; allBalls = new GameObject[22]; shotBallsOnTable = new List <BallColorEnum>(); shotBallsHit = new List <BallColorEnum>(); shotBallsPut = new List <BallColorEnum>(); inMenu = false; CurrentCameraPositionType = GameCameraController.CameraPositionType.Top; GameFinished = false; // Setting GameManager instance to this if (Instance == null) { Instance = this; } else { Destroy(this); } allBalls = GameObject.Find("PoolBalls").GetComponent <PoolBalls>().poolBalls; allSpots = GameObject.FindGameObjectsWithTag("Spot"); escMenu.SetActive(false); message.SetActive(false); Debug.Assert(GameObject.Find("GalaxyManager") && GalaxyManager.Instance.GalaxyFullyInitialized && GalaxyManager.Instance.IsSignedIn()); galaxyManagerActive = true; fouls = GalaxyManager.Instance.StatsAndAchievements.GetStatInt("fouls"); shotsTaken = GalaxyManager.Instance.StatsAndAchievements.GetStatInt("shotsTaken"); GalaxyManager.Instance.Matchmaking.SetLobbyMemberData("state", "go"); GameObject.Find("PopUps").GetComponent <PopUps>().ClosePopUps(); GameObject.Find("PopUps").GetComponent <PopUps>().PopUpWithLeaveLobbyButton("Waiting for other players", "back"); }
// First thing called on game start void Awake() { galaxyManagerActive = false; shotsTaken = 0; fouls = 0; ballOn = BallColorEnum.Red; foul = FoulEnum.Clear; threshold = 0.001f; allBalls = new GameObject[22]; shotBallsOnTable = new List <BallColorEnum>(); shotBallsHit = new List <BallColorEnum>(); shotBallsPut = new List <BallColorEnum>(); inMenu = false; CurrentCameraPositionType = GameCameraController.CameraPositionType.Top; GameFinished = false; if (Instance == null) { Instance = this; } else { Destroy(this); } allBalls = GameObject.Find("PoolBalls").GetComponent <PoolBalls>().poolBalls; allSpots = GameObject.FindGameObjectsWithTag("Spot"); escMenu.SetActive(false); message.SetActive(false); if (GameObject.Find("GalaxyManager") && GalaxyManager.Instance.GalaxyFullyInitialized && GalaxyManager.Instance.IsSignedIn()) { galaxyManagerActive = true; fouls = GalaxyManager.Instance.StatsAndAchievements.GetStatInt("fouls"); shotsTaken = GalaxyManager.Instance.StatsAndAchievements.GetStatInt("shotsTaken"); } }