IEnumerator TryToMatch(bool clockwise, HexagonTrio selectedHexagonTrio) { interactable = false; StartCoroutine(selectedHexagonTrio.TurnHexagonTrio(clockwise)); //First turn yield return(new WaitWhile(() => !selectedHexagonTrio.turnTrigger)); if (GridController._instance.MatchingQuery()) { CountMove(); StopCoroutine(lastMatchCoroutine); } else { yield return(new WaitForSeconds(0.1f)); StartCoroutine(selectedHexagonTrio.TurnHexagonTrio(clockwise)); //Second turn } yield return(new WaitWhile(() => !selectedHexagonTrio.turnTrigger)); if (GridController._instance.MatchingQuery()) { CountMove(); StopCoroutine(lastMatchCoroutine); } else { yield return(new WaitForSeconds(0.1f)); StartCoroutine(selectedHexagonTrio.TurnHexagonTrio(clockwise)); //Second turn } yield return(new WaitWhile(() => !selectedHexagonTrio.turnTrigger)); interactable = true; }