public void ClickCha(ChaCon cha)
    {
        if (cha.isOnBoat())
        {
            CoastCon nowCoast;
            if (boat.getStatus() == -1)
            {
                nowCoast = toCoast;                                      // to->-1; from->1
            }
            else
            {
                nowCoast = fromCoast;
            }
            boat.getOffBoat(cha.getName());

            Vector3 end_pos    = nowCoast.getEmptyPosition();                                                 //动作分离版本改变
            Vector3 middle_pos = new Vector3(cha.getGameObject().transform.position.x, end_pos.y, end_pos.z); //动作分离版本改变
            actionManager.moveCha(cha.getGameObject(), middle_pos, end_pos, cha.move_speed);                  //动作分离版本改变

            cha.getOnCoast(nowCoast);
            nowCoast.getOnCoast(cha);
        }
        else                                                                            // character on coast
        {
            CoastCon nowCoast = cha.getCoastCon();
            if (boat.getEmptyIndex() == -1)
            {
                return;                                          // boat is full
            }
            if (nowCoast.getStatus() != boat.getStatus())
            {
                return;                                                         // boat is not on the side of character
            }
            nowCoast.getOffCoast(cha.getName());

            Vector3 end_pos    = boat.getEmptyPosition();                                                     //动作分离版本改变
            Vector3 middle_pos = new Vector3(end_pos.x, cha.getGameObject().transform.position.y, end_pos.z); //动作分离版本改变
            actionManager.moveCha(cha.getGameObject(), middle_pos, end_pos, cha.move_speed);                  //动作分离版本改变

            cha.getOnBoat(boat);
            boat.getOnBoat(cha);
        }
        userGUI.status = Judger.getInstance().check(fromCoast, toCoast, boat);
        userGUI.tips   = AI.getInstance().tip(fromCoast, toCoast, boat);
    }
Пример #2
0
 public void ClickCha(ChaCon cha)
 {
     if (cha.isOnBoat())
     {
         CoastCon nowCoast;
         if (boat.getStatus() == -1)
         {
             nowCoast = toCoast;                                      // to->-1; from->1
         }
         else
         {
             nowCoast = fromCoast;
         }
         boat.getOffBoat(cha.getName());
         cha.moveToPosition(nowCoast.getEmptyPosition());
         cha.getOnCoast(nowCoast);
         nowCoast.getOnCoast(cha);
     }
     else                                                                            // character on coast
     {
         CoastCon nowCoast = cha.getCoastCon();
         if (boat.getEmptyIndex() == -1)
         {
             return;                                          // boat is full
         }
         if (nowCoast.getStatus() != boat.getStatus())
         {
             return;                                                         // boat is not on the side of character
         }
         nowCoast.getOffCoast(cha.getName());
         cha.moveToPosition(boat.getEmptyPosition());
         cha.getOnBoat(boat);
         boat.getOnBoat(cha);
     }
     userGUI.status = check();
 }
Пример #3
0
 public void ClickCha(ChaCon cha)
 {
     if (cha.isOnBoat())
     {
         CoastCon nowCoast;
         if (boat.getStatus() == -1)
         {
             nowCoast = toCoast;
         }
         else
         {
             nowCoast = fromCoast;
         }
         boat.getOffBoat(cha.getName());
         cha.moveToPosition(nowCoast.getEmptyPosition());
         cha.getOnCoast(nowCoast);
         nowCoast.getOnCoast(cha);
     }
     else
     {
         CoastCon nowCoast = cha.getCoastCon();
         if (boat.getEmptyIndex() == -1)
         {
             return;
         }
         if (nowCoast.getStatus() != boat.getStatus())
         {
             return;
         }
         nowCoast.getOffCoast(cha.getName());
         cha.moveToPosition(boat.getEmptyPosition());
         cha.getOnBoat(boat);
         boat.getOnBoat(cha);
     }
     userGUI.status = check();
 }