Ejemplo n.º 1
0
 public void Update()
 {
     if (floatingPiece != null && floatingPiece.IsMoving())
     {
         if (sr.vertical)
         {
             sr.vertical = false;
         }
     }
     else
     {
         if (!sr.vertical)
         {
             sr.vertical = true;
         }
     }
 }
Ejemplo n.º 2
0
    public void Update()
    {
        if (!gridloaded)
        {
            gridloaded = true;
            GameObject loader = GameObject.Find("NameHolder");
            LoadTower(loader.GetComponent <TowerLoad> ().towerName);
            Destroy(loader);
        }

        if (frameDelay > 0)
        {
            frameDelay--;
            if (frameDelay <= 0)
            {
                clearCheckPanel.SetActive(false);
            }
        }

        if (floatingPiece != null && floatingPiece.IsMoving())
        {
            if (sr.vertical)
            {
                sr.vertical = false;
            }
        }
        else
        {
            if (!sr.vertical)
            {
                sr.vertical = true;
            }
        }

        if (finger2down && finger1down)
        {
            Vector3 altClickPos   = InputWatcher.GetInputPosition(1);
            Vector3 firstClickPos = InputWatcher.GetInputPosition();
            Vector3 direction     = altClickPos - firstClickPos;
            float   newAngle      = Mathf.Atan2(direction.y, direction.x) * Mathf.Rad2Deg;
            float   diff          = newAngle - twoFingerAngle;
            floatingPiece.transform.eulerAngles = new Vector3(0, 0, pieceAngle + diff);
        }
    }