public void OnPose(string message) { MyoPose pose = (MyoPose)Enum.Parse(typeof(MyoPose), message, true); if (PoseEvent != null) { PoseEvent(pose); } }
public DeviceInformation(string serial, MyoPose pose, ClassifierType classifier, byte classifierIndex, bool customClassifier, byte streamIndicating, DeviceType device) { this.SerialNumber = serial; this.UnlockPose = pose; this.ActiveClassifierType = classifier; this.ActiveClassifierIndex = classifierIndex; this.HasCustomClassifier = customClassifier; this.StreamIndicating = streamIndicating; this.Device = device; }
public DeviceInformation (string serial, MyoPose pose, ClassifierType classifier, byte classifierIndex, bool customClassifier, byte streamIndicating, DeviceType device) { this.SerialNumber = serial; this.UnlockPose = pose; this.ActiveClassifierType = classifier; this.ActiveClassifierIndex = classifierIndex; this.HasCustomClassifier = customClassifier; this.StreamIndicating = streamIndicating; this.Device = device; }
/// <summary> /// This method is called on this object by the XCode plugin when a pose event occurs. Don't have any methods "OnPose(string)" on this game object to avoid issues. /// </summary> /// <param name="poseName">Name of pose that occurred</param> public void OnPose(string indexAndPoseName) { if (isEnabled) { //split string back into index and pose string[] indexPose = indexAndPoseName.Split(','); int index = 0; int.TryParse(indexPose[0], out index); MyoPose pose = (MyoPose)Enum.Parse(typeof(MyoPose), indexPose[1]); if (PoseEvent != null) { PoseEvent(index, pose); } } }
// Update is called once per frame void Update() { if (!MyoManager.GetIsAttached()) { } else { if (myoPose != lastPose) { if (myoPose == MyoPose.DOUBLE_TAP) { mainScript.TapControl(); locked = !locked; lastPose = myoPose; } if (myoPose == MyoPose.REST) { lastPose = myoPose; } if (!locked) { if (myoPose == MyoPose.FIST) { StartCoroutine("isFistHold"); lastPose = myoPose; } if (myoPose == MyoPose.FINGERS_SPREAD) { lastPose = myoPose; mainScript.AbrirMenu(); } if (myoPose == MyoPose.WAVE_OUT) { StartCoroutine("isWOHold"); lastPose = myoPose; } if (myoPose == MyoPose.WAVE_IN) { StartCoroutine("isWIHold"); lastPose = myoPose; } } } } }
void OnPoseEvent(MyoPose pose) { myoPose = pose; }
void OnPoseEvent( MyoPose pose ) { myoPose = pose; }
void OnPoseEvent(int index, MyoPose pose) { myoPose = pose; }