/** * Get hand event. * */ void MessageFun(string messageKey, object param1, object param2) { if (messageKey.CompareTo(Hi5_Glove_Interaction_Message.Hi5_MessageMessageKey.messageHandEvent) == 0) { Hi5_Glove_Interaction_Hand_Event_Data data = param1 as Hi5_Glove_Interaction_Hand_Event_Data; bool isRun = false; if (data.mHandType == EHandType.EHandLeft && mHand.m_IsLeftHand) { isRun = true; } else if (data.mHandType == EHandType.EHandRight && !mHand.m_IsLeftHand) { isRun = true; } if (!isRun) { return; } switch (data.mEventType) { case EEventHandType.EClap: if (data.mHandType == EHandType.EHandLeft && mHand.m_IsLeftHand) { HI5_Manager.EnableLeftVibration(200); } else if (data.mHandType == EHandType.EHandRight && !mHand.m_IsLeftHand) { HI5_Manager.EnableRightVibration(200); } break; case EEventHandType.EPoke: break; case EEventHandType.EPinch: break; case EEventHandType.EThrow: break; case EEventHandType.ELift: break; case EEventHandType.ERelease: break; } } }
private void Vibrate() { if (grab == null) { return; } int time = 80; if (grab.gameObject.layer == 9) { HI5_Manager.EnableRightVibration(time); } if (grab.gameObject.layer == 10) { HI5_Manager.EnableLeftVibration(time); } }