public void OnRecognize(RecognitionResult result, DrawDetector detector)
    {
        if (result != RecognitionResult.Empty)
        {
            StartCoroutine(DeleteCoroutine(detector));

            spawnOffset = transform.forward * 0.1f;

            Debug.Log(result.gesture.id + "\n" + Mathf.RoundToInt(result.score.score * 100) + "%");


            if (result.gesture.id == "Glyph1")
            {
                Instantiate(kekPrefab, transform.position + spawnOffset, Quaternion.identity);
            }
            else
            {
                player.GetComponent <PlayerScript>().GetDamageBuff();
                Instantiate(malPrefab, transform.position + spawnOffset, Quaternion.identity);
            }
        }
        else
        {
            detector.ClearLines();
            Debug.Log("? ? ?");
        }
    }
Exemple #2
0
 private void onFingerDown(Lean.Touch.LeanFinger finger)
 {
     //Debug.Log("Finger down event");
     if (Lean.Touch.LeanTouch.Fingers.Count > 1)
     {
         //Debug.Log("Multiple Fingers Down -  Clear Lines");
         detector.ClearLines();
     }
 }
    private void DisableDrawing()
    {
        StopCoroutine(EnableDrawing());

        print("Disabling All");

        playerDrawDet.ClearLines();

        foreach (DrawDetector d in detectors)
        {
            d.enabled = false;
        }
    }
 public void OnRecognize(RecognitionResult result)
 {
     //StopAllCoroutines();
     if (result != RecognitionResult.Empty)
     {
         _drawDetector.ClearLines();
         textResult.text = result.gesture.id + "\n" + Mathf.RoundToInt(result.score.score * 100) + "%";
         if (result.score.score >= 0.7f)
         {
             StartCoroutine(SendAction(result.gesture.id));
             gameManager.message = result.gesture.id;
         }
         else
         {
             textResult.text     = result.gesture.id + "\n" + Mathf.RoundToInt(result.score.score * 100) + "% very low";
             gameManager.message = "";
         }
     }
     else
     {
         _drawDetector.ClearLines();
     }
 }
Exemple #5
0
 //Erase Button
 public void eraseButtonClick()
 {
     dd.ClearLines();
 }
    IEnumerator DeleteCoroutine(DrawDetector det)
    {
        yield return(new WaitForSeconds(1.0f));

        det.ClearLines();
    }