示例#1
0
文件: UserGUI.cs 项目: dongchenyu/3D-
 void OnMouseDown()
 {
     if (status != 1)
     {
         if (gameObject.name == "boat")
         {
             action.MoveBoat();
             // update state
             int  rightPriest = controller.rightCoastCtrl.GetCharacterNum()[0];
             int  rightDevil  = controller.rightCoastCtrl.GetCharacterNum()[1];
             int  leftPriest  = controller.leftCoastCtrl.GetCharacterNum()[0];
             int  leftDevil   = controller.leftCoastCtrl.GetCharacterNum()[1];
             bool location    = controller.boatCtrl.boat.Location == Location.left ? true : false;
             int  pcount      = controller.boatCtrl.GetCharacterNum()[0];
             int  dcount      = controller.boatCtrl.GetCharacterNum()[1];
             if (location)
             {
                 leftPriest += pcount;
                 leftDevil  += dcount;
             }
             else
             {
                 rightPriest += pcount;
                 rightDevil  += dcount;
             }
             state = new IState(leftPriest, leftDevil, rightPriest, rightDevil, location, null);
         }
         else
         {
             action.CharacterClicked(characterCtrl);
         }
     }
 }
示例#2
0
 void OnMouseDown()
 {
     if (gameObject.name == "boat")
     {
         action.MoveBoat();
     }
     else
     {
         action.CharacterClicked(characterCtrl);
     }
 }
示例#3
0
 public void OnMouseDown()
 {
     //Debug.Log("status" + status);
     if (flag == true)
     {
         return;
     }
     if (gameObject.name == "boat")
     {
         action.MoveBoat();
     }
     else
     {
         action.CharacterClicked(characterController);
     }
 }