示例#1
0
 public States Main_InGrab(States currentState)
 {
     if (otherState.currentState != States.GRAB)
     {
         mechanics.GrabDeattach(otherPlayer);
         return(States.IDLE);
     }
     return(currentState);
 }
示例#2
0
 public States Main_Grab(States currentState)
 {
     otherState.currentState = States.IN_GRAB;
     mechanics.GrabAttach(gameObject, otherPlayer);
     if (!command.Grab()) //grab key
     {
         mechanics.GrabDeattach(otherPlayer);
         return(States.IDLE);
     }
     else if (command.MoveLeft()) //move key
     {
         mechanics.MoveLeft();
     }
     else if (command.MoveRight()) //move key
     {
         mechanics.MoveRight();
     }
     return(currentState);
 }