void Awake() { leftHandDetector = new GameObject("LeftHandDetector"); leftHandDetector.transform.parent = gameObject.transform; ZigMapJointToSession leftMap = leftHandDetector.AddComponent <ZigMapJointToSession>(); leftMap.joint = ZigJointId.LeftHand; rightHandDetector = new GameObject("RightHandDetector"); rightHandDetector.transform.parent = gameObject.transform; ZigMapJointToSession rightMap = rightHandDetector.AddComponent <ZigMapJointToSession>(); rightMap.joint = ZigJointId.RightHand; if (StartOnSteady) { ZigSteadyDetector steadyLeft = leftHandDetector.AddComponent <ZigSteadyDetector>(); steadyLeft.Steady += delegate(object sender, EventArgs ea) { CheckSessionStart((sender as ZigSteadyDetector).steadyPoint, ZigJointId.LeftHand); }; ZigSteadyDetector steadyRight = rightHandDetector.AddComponent <ZigSteadyDetector>(); steadyRight.Steady += delegate(object sender, EventArgs ea) { CheckSessionStart((sender as ZigSteadyDetector).steadyPoint, ZigJointId.RightHand); }; } if (StartOnWave) { ZigWaveDetector waveLeft = leftHandDetector.AddComponent <ZigWaveDetector>(); waveLeft.Wave += delegate(object sender, EventArgs ea) { Debug.Log("Wave from left"); CheckSessionStart((sender as ZigWaveDetector).wavePoint, ZigJointId.LeftHand); }; ZigWaveDetector waveRight = rightHandDetector.AddComponent <ZigWaveDetector>(); waveRight.Wave += delegate(object sender, EventArgs ea) { Debug.Log("Wave from right"); CheckSessionStart((sender as ZigWaveDetector).wavePoint, ZigJointId.RightHand); }; } }
void WaveDetector_Wave(ZigWaveDetector wd) { Debug.Log("Wave Detector wave detected"); }
void WaveDetector_Wave(ZigWaveDetector wd) { Debug.Log("Wave Detector wave detected"); }