protected void SendPick(int index) { TileSelectedMsg msg = new TileSelectedMsg { SelectedIndex = index }; Messenger.GetInstance().BroadCastMessage(msg); }
private void WaitForPick(Message msg) { TileSelectedMsg tileSelected = msg as TileSelectedMsg; lastSelectedTile = tileSelected.SelectedIndex; TileMB.TileState tileOwner = playerOne ? TileMB.TileState.PLAYER1 : TileMB.TileState.PLAYER2; gameBoard.SelectTile(lastSelectedTile, tileOwner); Debug.Log(string.Format("Tile {0} Was Selected", lastSelectedTile)); SwitchState("Evaluate"); gameBoard.EnablePicks(false); }
private IEnumerator SelectTilesCoroutine(DebugSettings settings) { WaitForSeconds delayBetweenMoves = new WaitForSeconds(1f / settings.playBackSpeed); int[] moves = settings.tileSelections; for (int i = 0; i < moves.Length; i++) { TileSelectedMsg msg = new TileSelectedMsg(); msg.SelectedIndex = moves[i]; Messenger.GetInstance().BroadCastMessage(msg); yield return(delayBetweenMoves); } }
private void AttempSelection() { if (selectedState != TileState.OPEN) { Debug.Log("This Space Is Taken!"); } else { TileSelectedMsg msg = new TileSelectedMsg { SelectedIndex = tileIndex }; Messenger.GetInstance().BroadCastMessage(msg); } }