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(); } } }
public void rotate() { if (!GamePause.isPaused() && !endgame.isActive()) { blocks.getBlock().GetComponent <Block>().rotate(); } else if (GamePause.isPaused() && !endgame.isActive()) { GamePause.deactivateAnimated(); } }
public void moveDown() { if (!GamePause.isPaused() && !endgame.isActive()) { blocks.getBlock().GetComponent <Block>().speedUp = true; } else if (GamePause.isPaused() && !endgame.isActive()) { GamePause.deactivateAnimated(); } }
void Update() { if (activated && Input.touchCount > 0 && isExtraWindowsDisabled()) { if (!GamePause.isPaused()) { if (isSwipeEnd() && isMovedMinimumDistance()) { if (isSwpiedHorizontal()) { swipeHorizontal(); } else { swipeVertical(); } } } else { GamePause.deactivateAnimated(); } } }
public void deactivateAnimated() { anim.Play("SettingsHide"); GamePause.deactivateAnimated(); }