public void SetJsonGoalsFromCurrentHand(JsonSign sign)
 {
     sign._goal0 = fingers[0].rootNodeAngle_01;
     sign._goal1 = fingers[1].rootNodeAngle_01;
     sign._goal2 = fingers[2].rootNodeAngle_01;
     sign._goal3 = fingers[3].rootNodeAngle_01;
     sign._goal4 = fingers[4].rootNodeAngle_01;
 }
    public void AddCurrentSignToLibrary(string name)
    {
        JsonSign s = new JsonSign();

        UnitySign newSign = new UnitySign(s);

        newSign._recognizer = this;

        newSign.Name = name;


        newSign._sign._goal0 = _hand.fingers[0].rootNodeAngle_01;
        newSign._sign._goal1 = _hand.fingers[1].rootNodeAngle_01;
        newSign._sign._goal2 = _hand.fingers[2].rootNodeAngle_01;
        newSign._sign._goal3 = _hand.fingers[3].rootNodeAngle_01;
        newSign._sign._goal4 = _hand.fingers[4].rootNodeAngle_01;

        _signs.Add(newSign);
    }
Exemple #3
0
    public void SetGrabPose(string name)
    {
        transform.SetParent(lastHand._handRoot);

        JsonSign grabSignFile = new JsonSign();

        grabSignFile._name = name;
        lastHand.SetJsonGoalsFromCurrentHand(grabSignFile);
        profile          = new ItemInteractiveProfie();
        profileName      = name;
        profile.localPos = transform.localPosition;
        profile.localRot = transform.localRotation;

        profile.sign = grabSignFile;

        transform.SetParent(parent);
        transform.localPosition = startLocalPos;
        transform.localRotation = startRot;

        string _json = JsonUtility.ToJson(profile);

        Debug.Log(_json);
        File.WriteAllText(_filesPath + "/" + gameObject.name + ".json", _json);
    }
 public UnitySign(JsonSign jSign)
 {
     _sign = jSign;
 }