Ejemplo n.º 1
0
    void Update()
    {
        if (toggled)
        {
            twisttools();

            if (Input.GetKeyDown(thief.exitint))
            {
                //print ("exit");
                thief.inp();
                toggled = false;
                lockpick.gameObject.SetActive(false);
                thief.incrime = false;
            }
        }
        //set below not run when at dest--eats cpu
        movedoor();
    }
Ejemplo n.º 2
0
    void Update()
    {
        if (toggled)
        {
            if (Input.GetKeyDown(up) || Input.GetKeyDown(down))
            {
                //Debug.Log ("in");
                inpnum [current]        = 1 - inpnum [current];
                screennum[current].text = "" + inpnum [current];
            }
            if (Input.GetKeyDown(left) && current > 0)
            {
                current--;
            }
            if (Input.GetKeyDown(right) && current < inpnum.Length - 1)
            {
                current++;
            }

            if (Input.GetKeyDown(player.exitint))
            {
                //print ("exit");
                player.inp();
                toggled = false;
            }
            if (Input.GetKeyDown(setcode))
            {
                //print ("exit");
                unlocked = true;
                int right = 0;
                for (int i = 0; i < code.Length; i++)
                {
                    if (code [i] != inpnum [i])
                    {
                        unlocked = false;
                        //break;
                    }
                    else
                    {
                        print("partright");
                        right++;
                    }
                }
                //print ("hacked: "+unlocked);
                if (unlocked)
                {
                    reward();
                    tries = 0;
                    off();
                }
                if (tries < 2)
                {
                    off();
                    print("failed");
                }
                tries--;
                screentries.text = "" + tries;
                screenright.text = "" + right;
            }
        }
    }
Ejemplo n.º 3
0
 void off()
 {
     print("off");
     player.inp();
     gameObject.SetActive(false);
 }