void Start() { if (stateInitial == VRGestureManagerState.ReadyToDetect) { BeginDetect(""); } else if (FindObjectOfType <VRGestureUI>() == null) { Debug.LogError("Cannot find VRGestureUI in scene. Please add it or select Begin In Detect Mode in the VR Gesture Manager Settings"); } state = stateInitial; stateLast = state; gestureToRecord = ""; input = rig.GetInput(gestureHand); //create a new Trainer currentTrainer = new Trainer(Gestures, currentNeuralNet); currentCapturedLine = new List <Vector3>(); if (displayGestureTrail) { myTrail = gameObject.AddComponent <GestureTrail>(); } perpTransform = new GameObject("Perpindicular Head").transform; perpTransform.parent = this.transform; }
public CaptureHand(VRGestureRig _rig, Transform _perp, Handedness _hand, GestureTrail _myTrail = null) { rig = _rig; hand = _hand; playerHand = rig.GetHand(hand); playerHead = rig.head; perpTransform = _perp; input = rig.GetInput(hand); currentCapturedLine = new List <Vector3>(); if (_myTrail != null) { myTrail = _myTrail; myTrail.AssignHand(this); } Start(); }