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