Esempio n. 1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetAxisRaw("Horizontal") > 0)
     {
         boardTransform.RotateAround(target, Vector3.back, 60 * Time.deltaTime);
         bgScript.rotate(1);
     }
     else if (Input.GetAxisRaw("Horizontal") < 0)
     {
         boardTransform.RotateAround(target, Vector3.forward, 60 * Time.deltaTime);
         bgScript.rotate(-1);
     }
     if (pScript.getState())
     {
         reset();
     }
 }
Esempio n. 2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        if (!isCompleted && getActive())
        {
            //Inputs
            if (Input.GetAxisRaw("Horizontal") > 0)
            {
                boardTransform.RotateAround(target, Vector3.back, 60 * Time.deltaTime);
                bgScript.rotate(1);
            }
            else if (Input.GetAxisRaw("Horizontal") < 0)
            {
                boardTransform.RotateAround(target, Vector3.forward, 60 * Time.deltaTime);
                bgScript.rotate(-1);
            }
            else if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.Return))
            {
                pause();
            }

            //Events controller
            if (keysScripts.getKeysState())
            {
                escapeGateScript.switchCol();
            }
            //Level succeed
            if (escapeGateScript.getGateState())
            {
                completed();
            }
            //Level failed
            if (pScript.getState())
            {
                reset();
            }
        }
    }