public void initialize(ZgManager aZig) { var mZigObject = ManagerManager.Manager.gameObject; //mZigObject.AddComponent<kinectSpecific>(); mZig = mZigObject.GetComponent <Zig>(); //TODO try this again... /* * mZig = mZigObject.AddComponent<Zig>(); * mZig.inputType = ZigInputType.Auto; * mZig.settings.UpdateDepth = true; * mZig.settings.UpdateImage = true; * mZig.settings.AlignDepthToRGB = false; * mZig.settings.OpenNISpecific.Mirror = true; * mZigObject.AddComponent<ZigEngageSingleUser>(); */ //ZigEngageSingleUser scans for all users but only reports results from one of them (the first I guess) //normally this is set in editor initializers but we don't do that here mZigEngageSingleUser = mZigObject.GetComponent <ZigEngageSingleUser>(); mZigEngageSingleUser.EngagedUsers = new System.Collections.Generic.List <UnityEngine.GameObject>(); mZigEngageSingleUser.EngagedUsers.Add(mZigObject); //this is the only way to get callbacks from ZigEngageSingleUser mZigCallbackBehaviour = mZigObject.AddComponent <ZigCallbackBehaviour>(); mZigCallbackBehaviour.mUpdateUserDelegate += Zig_UpdateUser; mZigCallbackBehaviour.mUpdateInputDelegate += Zig_UpdateInput; }
void UserEngaged(ZigEngageSingleUser user) { trackedUser = user.engagedTrackedUser; }
void UserEngaged(ZigEngageSingleUser user) { Debug.Log("UserEngaged hand"); }