private void Update() { if (isSwap) { float MovementSpeed = 3f; selectObj1.transform.position = Vector2.MoveTowards(selectObj1.transform.position, selectObj2Pos, MovementSpeed * Time.deltaTime); selectObj2.transform.position = Vector2.MoveTowards(selectObj2.transform.position, selectObj1Pos, MovementSpeed * Time.deltaTime); if ((Vector2)selectObj1.transform.position == selectObj2Pos && (Vector2)selectObj2.transform.position == selectObj1Pos) { isSwap = false; M3S.IsMatch(selectObj1); } } }
private bool checkAllTiles() { bool isMatched = false; bool temp = false; for (int i = 0; i < xSize; i++) { for (int j = 0; j < ySize; j++) { temp = M3S.IsMatch(tiles[i, j]); if (temp) { isMatched = true; } } } return(isMatched); }