protected void init(Hi5_Glove_Interaction_Hand hand)
        {
            mJudgeMent = new Hi5_Object_JudgeMent();
            mDecision  = new Hi5_Glove_Decision(mJudgeMent, hand, this);
            Hi5_Glove_State_Pinch pinchState = new Hi5_Glove_State_Pinch();

            pinchState.Init(hand, this, mDecision);
            Hi5_Glove_State_Release releaseState = new Hi5_Glove_State_Release();

            releaseState.Init(hand, this, mDecision);
            Hi5_Glove_State_Pinch2 pinch2 = new Hi5_Glove_State_Pinch2();

            pinch2.Init(hand, this, mDecision);
            Hi5_Glove_State_Clap clap = new Hi5_Glove_State_Clap();

            clap.Init(hand, this, mDecision);

            Hi5_Glove_State_Lift Lift = new Hi5_Glove_State_Lift();

            Lift.Init(hand, this, mDecision);
            mDicState.Add(E_Hand_State.EClap, clap);
            mDicState.Add(E_Hand_State.ELift, Lift);
            mDicState.Add(E_Hand_State.EPinch, pinchState);
            mDicState.Add(E_Hand_State.ERelease, releaseState);
            mDicState.Add(E_Hand_State.EPinch2, pinch2);
            mCurrentState = releaseState;

            mJudgeMent.mStateManager = this;
            mJudgeMent.Hand          = hand;
        }
 internal Hi5_Glove_State_Lift GetLift()
 {
     if (mDicState.ContainsKey(E_Hand_State.ELift))
     {
         Hi5_Glove_State_Lift temp = mDicState[E_Hand_State.ELift] as Hi5_Glove_State_Lift;
         return(temp);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 3
0
        internal bool IsLift()
        {
            int objectId = 0;
            // Hi5_Glove_Interaction_Finger_Type fingType;
            bool islift = mHand.mState.mJudgeMent.IsLift(out objectId);

            Hi5_Glove_Interaction_Item item = Hi5_Interaction_Object_Manager.GetObjectManager().GetItemById(objectId);

            if (item != null &&
                item.mObjectType == EObject_Type.ECommon &&
                (item.state == E_Object_State.EStatic ||                 /*|| item.state == E_Object_State.EPinch || item.state == E_Object_State.EFlyLift || item.state == E_Object_State.EClap*/
                 (item.state == E_Object_State.EMove)) &&
                islift)
            {
                Hi5_Glove_State_Lift liftState = mHand.mState.GetBaseState(E_Hand_State.ELift) as Hi5_Glove_State_Lift;
                liftState.objectId = objectId;
                Hi5_Glove_Interaction_Hand handTemp = mHand;
                Hi5_Interaction_Message.GetInstance().DispenseMessage(Hi5_MessageKey.messageLiftObject, mHand, objectId);
                if (Hi5_Interaction_Const.TestChangeState)
                {
                    mState.ChangeState(E_Hand_State.ELift);
                }
                {
                    Hi5_Glove_Interaction_Object_Event_Data data = Hi5_Glove_Interaction_Object_Event_Data.Instance(item.idObject,
                                                                                                                    item.mObjectType,
                                                                                                                    handTemp.m_IsLeftHand ? EHandType.EHandLeft : EHandType.EHandRight,
                                                                                                                    EEventObjectType.ELift);
                    Hi5InteractionManager.Instance.GetMessage().DispenseMessage(Hi5_Glove_Interaction_Message.Hi5_MessageMessageKey.messageObjectEvent, (object)data, null);
                }

                {
                    Hi5_Glove_Interaction_Hand_Event_Data data = Hi5_Glove_Interaction_Hand_Event_Data.Instance(item.idObject,
                                                                                                                handTemp.m_IsLeftHand ? EHandType.EHandLeft : EHandType.EHandRight,
                                                                                                                EEventHandType.ELift);
                    Hi5InteractionManager.Instance.GetMessage().DispenseMessage(Hi5_Glove_Interaction_Message.Hi5_MessageMessageKey.messageHandEvent, (object)data, null);
                }


                //Hi5_Glove_Interaction_Object_Event_Data data = new Hi5_Glove_Interaction_Object_Event_Data();
                //if (Hand.m_IsLeftHand)
                //    data.mHandType = EHandType.EHandLeft;
                //else
                //    data.mHandType = EHandType.EHandRight;
                //data.mObjectType = item.mObjectType;
                //data.mEventType = EEventType.ELift;
                //data.mObjectId = item.idObject;
                //Hi5InteractionManger.Instance.GetMessage().DispenseMessage(Hi5_Glove_Interaction_Message.Hi5_MessageMessageKey.messageObjectEvent, (object)data, null);
                return(true);
            }
            return(false);
        }