//When sequence of cells completed we create "highlight" animation effect public void ShowWinSequence(CheckWinResult result) { if (result != null) { StartCoroutine(CorShowWinSequence(result.winSequence)); } }
private void OnWinResult(EventData eventData) { WinResultEventData winResultEventData = eventData as WinResultEventData; if (winResultEventData.result != null) { m_WinResult = winResultEventData.result; } }
private bool CheckToWin(out CheckWinResult winResult) { winResult = null; if (countOfEmptyCells == 0) { winResult = new CheckWinResult(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8 }, CellState.empty, RoundResultType.deadHeat); } foreach (var sequence in m_WinSequences) { if (CheckToWinSequence(sequence)) { winResult = new CheckWinResult(sequence, m_Cells[sequence[0]].state, CellState2RoundResultType(m_Cells[sequence[0]].state)); return(true); } } return(false); }
public WinResultEventData(CheckWinResult result) { this.result = result; }