public Scene(GameObjectManager objectManager, ISceneManager sceneManager, SceneType sceneType) { this.sceneManager = sceneManager; this.sceneType = sceneType; ObjectManager = objectManager; GameObjectState = objectManager; }
void Start() { collectionBox = GameObject.FindGameObjectWithTag("CollectionBox"); if (canvas.activeInHierarchy == false) { Debug.LogError("canvas is not active"); canvas.SetActive(true); } if (poolTable.activeInHierarchy == false) { poolTable.SetActive(true); } if (cueBall.activeInHierarchy == false) { cueBall.SetActive(true); } if (cue.activeInHierarchy == false) { cue.SetActive(true); } if (redBalls.activeInHierarchy == false) { redBalls.SetActive(true); } #region resetVariables redBallsResetPosition = new List <Vector3>(); cueResetPosition = cue.transform.position; for (int i = 0; i < redBalls.transform.childCount; i++) { redBallsResetPosition.Add(redBalls.transform.GetChild(i).position); Debug.Log(redBallsResetPosition[i]); } #endregion factor = 0; cuePosition = Vector3.zero; strikeDirection = Vector3.forward; //OtherPlayer = new Player("Doe","Player2CollectedBalls"); imagePanel = GameObject.FindGameObjectWithTag("imagePanel"); imagePanel.SetActive(false); image = GameObject.FindGameObjectWithTag("cueImage"); if (cueBallCanvas == null) { Debug.LogError("Not found error "); } winnerMessage.GetComponent <Canvas>().enabled = false; gameState = StatesOfGame.WAITING_FOR_STRIKE_STATE; currentState = new GameStates.WaitingForStrikeState(this); }
void Start() { strikeDirection = Vector3.forward; // sets the player name, if time let user set it Player_one = new Player("P1"); Player_two = new Player("P2"); GameInstance = this; winnerMessage.GetComponent <Canvas>().enabled = false; currentState = new GameStates.WaitingForStrikeState(this); }
void Start() { strikeDirection = Vector3.forward; CurrentPlayer = new Player("John"); OtherPlayer = new Player("Doe"); GameInstance = this; winnerMessage.GetComponent <Canvas>().enabled = false; currentState = new GameStates.WaitingForStrikeState(this); }
void Start() { // Physics.gravity = new Vector3(-112, 98, -16); strikeDirection = Vector3.left; CurrentPlayer = new Player("Anan1"); OtherPlayer = new Player("Anan2"); GameInstance = this; winnerMessage.GetComponent <Canvas>().enabled = false; currentState = new GameStates.WaitingForStrikeState(this); }
public void ActivateState(IGameObjectState state) { if (activeState != null) { activeState.OnStateEnd(); } activeState = state; if (activeState != null) { activeState?.OnStateStart(); } }
void Start() { /*if(!isLocalPlayer){ * Destroy(this); * }*/ strikeDirection = joystick.strikeDir(); CurrentPlayer = new Player("John"); OtherPlayer = new Player("Doe"); /* * GameInstance = this; * winnerMessage.GetComponent<Canvas>().enabled = false; */ currentState = new GameStates.WaitingForStrikeState(this); }
void Start() { cueBallDirection = Vector3.forward; GameInstance = this; currentState = new Game.cuePosition(this); }
public void SetCurrentState(IGameObjectState state) { currentState = state; }
public virtual void ActivateState(IGameObjectState state) { state.OnStateStart(); activeStates.Add(state); }
void Start() { strikeDirection = Vector3.forward; CurrentPlayer = new Player("John"); OtherPlayer = new Player("Doe"); GameInstance = this; winnerMessage.GetComponent<Canvas>().enabled = false; currentState = new GameStates.WaitingForStrikeState(this); }
// Use this for initialization void Start() { GameInstance = this; currentState = new GameStates.StartingGame(this); startGame = false; }