コード例 #1
0
 //initial manager
 public void Start()
 {
     manager = GestureSourceManager.Instance;
     manager.RemoveDetectors();
     manager.AddDetector("recognize");
     manager.OnGesture += recognize;
     instance           = this;
 }
コード例 #2
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.A))
     {
         Debug.Log("Press A");
         manager.RemoveDetectors();
         manager.AddDetector("recognize");
     }
 }
コード例 #3
0
    //judge helmet
    private void recognize(object sender, KinectGestureEvent e)
    {
        if (e.name.Equals("recognize"))
        {
            //GameObject.Find ("CreateDiagram").GetComponent<HistogramTexture> ().setHeight (e.confidence);
            if (e.confidence > 0.7)
            {
                //	PlayerPrefs.SetString("BodyId",e.getOpt("BodyId"));
                //judge event done
                ulong id = Convert.ToUInt64(e.getOpt("BodyId"));
                Debug.Log("detect bodyid is " + id);
                manager.confirmBody(id);
                manager.OnGesture -= recognize;
                DontDestroyOnLoad(bodymanager);
                SceneManager.LoadScene("Menu");
                manager.RemoveDetectors();

                /*manager.AddDetector ("walk");
                 * manager.OnGesture += walking;
                 * Debug.Log ("Add Walk");*/
            }
        }
    }