//---------------------------------------------------------- // Unity calback methods //---------------------------------------------------------- void Awake() { Application.runInBackground = true; if (SmartFoxConnection.IsInitialized) { sfs = SmartFoxConnection.Connection; } else { SceneManager.LoadScene("Login"); return; } sfs.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost); sfs.AddEventListener(SFSEvent.PUBLIC_MESSAGE, OnPublicMessage); sfs.AddEventListener(SFSEvent.USER_ENTER_ROOM, OnUserEnterRoom); sfs.AddEventListener(SFSEvent.USER_EXIT_ROOM, OnUserExitRoom); setCurrentGameState(GameState.WAITING_FOR_PLAYERS); // Create game logic controller instance trisGame = new TrisGame(); trisGame.InitGame(sfs); }
// Use this for initialization public void Reset(TrisGame instance, bool playerHasCross) { gameInstance = instance; //currentTileState = TileState.EMPTY; SetTileState(TileState.EMPTY); this.playerHasCross = playerHasCross; clickEnabled = false; }
// Use this for initialization public void Reset(TrisGame instance, bool playerHasCross) { gameInstance = instance; //currentTileState = TileState.EMPTY; SetTileState(TileState.EMPTY); this.playerHasCross = playerHasCross; clickEnabled = false; x = int.Parse(this.transform.name.Substring(4, 1)); y = int.Parse(this.transform.name.Substring(5, 1)); }