void Update() { if (activated && Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began) { if (!GamePause.isPaused() && isExtraWindowsDisabled()) { touchPos = Camera.main.ScreenToWorldPoint(Input.GetTouch(0).position); if (toRotate()) { blocks.getBlock().GetComponent <Block>().rotate(); } else if (toMoveDown()) { blocks.getBlock().GetComponent <Block>().speedUp = true; } else if (toTurnLeft()) { blocks.getBlock().GetComponent <Block>().turnLeft(); } else { blocks.getBlock().GetComponent <Block>().turnRight(); } } else { GamePause.deactivateAnimated(); } } }
private void swipeHorizontal() { if (touchEndPos.x > touchStartPos.x) { blocks.getBlock().GetComponent <Block>().turnRight(); } else { blocks.getBlock().GetComponent <Block>().turnLeft(); } }
public void moveLeft() { if (!GamePause.isPaused() && !endgame.isActive()) { blocks.getBlock().GetComponent <Block>().turnLeft(); } else if (GamePause.isPaused() && !endgame.isActive()) { GamePause.deactivateAnimated(); } }