Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (type != SRType.NoInput)
     {
         ProcessGesture(screenInput.getInput());
     }
 }
Example #2
0
 // Update is called once per frame
 void Update()
 {
     mov = screenInput.getInput();
     if (mov == move.pressed)
     {
         initPos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         ganzObj.transform.parent = null;
         transform.right          = initPos;
         ganzObj.transform.parent = transform;
     }
     if (mov == move.pressing || mov == move.help)
     {
         actualPos       = Camera.main.ScreenToWorldPoint(Input.mousePosition);
         transform.right = actualPos;
         if (ganzObj.transform.eulerAngles.z > lastAngle + angleSeparation)
         {
             lastAngle = ganzObj.transform.eulerAngles.z;
             if (!(ganzObj.transform.eulerAngles.z < unlockPosition + rangeUnlock &&
                   ganzObj.transform.eulerAngles.z > unlockPosition - rangeUnlock))
             {
                 src.PlayOneShot(clip);
                 canClick = true;
             }
         }
         else if (ganzObj.transform.eulerAngles.z < lastAngle - angleSeparation)
         {
             lastAngle = ganzObj.transform.eulerAngles.z;
             if (!(ganzObj.transform.eulerAngles.z < unlockPosition + rangeUnlock &&
                   ganzObj.transform.eulerAngles.z > unlockPosition - rangeUnlock))
             {
                 src.PlayOneShot(clip);
                 canClick = true;
             }
         }
         if (canClick && ganzObj.transform.eulerAngles.z < unlockPosition + rangeUnlock &&
             ganzObj.transform.eulerAngles.z > unlockPosition - rangeUnlock)
         {
             src.PlayOneShot(clipFound);
             canClick = false;
         }
     }
     if (screenInput.released(mov))
     {
         if (!canClick)
         {
             open();
         }
         else
         {
             src.PlayOneShot(closeSound);
         }
     }
 }
Example #3
0
 void Update()
 {
     //si se está en fase de reconocimiento (srm esta en modo NoInput para no tener en cuenta los swipes en esta fase)
     if (srm.type == SRType.NoInput)
     {
         // con doble click se activa la fase de seleccion
         if (input.getInput() == move.doubleClick && !selectionPhase)
         {
             // el invoke es necesario para que no se detecte la doble pulsacion en el mismo frame
             ScreenInput.instance.deactivate(0.1f);
             Invoke("goToSelection", 0.1f);
         }
     }
 }
Example #4
0
 // Update is called once per frame
 void Update()
 {
     ProcessGesture(screenInput.getInput());
 }
Example #5
0
 //Controla los pasos realizados con el Input en pantalla
 void steps()
 {
     mov = input.getInput();
     if (src.isPlaying)
     {
         anim.enabled = true;
     }
     else
     {
         anim.enabled = false;
         if (actualSteps >= normalSteps.Length + grassSteps + woodSteps.Length)
         {
             genPhase = 3;
             playSound(2);
             //TTS.instance.PlayTTS("Desliza en cualquier dirección para romper las bandas policiales");
         }
     }
     if (mov == move.pressing || mov == move.help)
     {
         if (phase == 0 && !src.isPlaying)
         {
             if (actualSteps < normalSteps.Length)
             {
                 src.clip = normalSteps[actualSteps];
                 src.Play();
                 actualSteps++;
             }
             else
             {
                 src.clip = grassStep;
                 phase    = 1;
             }
         }
         if (phase == 1 && !src.isPlaying)
         {
             if (actualSteps < normalSteps.Length + grassSteps)
             {
                 src.clip = grassStep;
                 src.Play();
                 actualSteps++;
             }
             else
             {
                 src.clip = woodSteps[0];
                 phase    = 2;
             }
         }
         if (phase == 2 && !src.isPlaying)
         {
             if (actualSteps < normalSteps.Length + grassSteps + woodSteps.Length)
             {
                 src.clip = woodSteps[actualSteps - normalSteps.Length - grassSteps];
                 src.Play();
                 actualSteps++;
             }
             else
             {
                 src.Stop();
                 genPhase = 3;
             }
         }
     }
 }