예제 #1
0
    public void loadResources()
    {
        GameObject water = Instantiate(Resources.Load("Prefabs/water", typeof(GameObject)), water_pos, Quaternion.identity, null) as GameObject;

        water.name = "water";
        fromCoast  = new Coast_model("from");
        toCoast    = new Coast_model("to");
        boat       = new Boat_model();
        for (int i = 0; i < 3; i++)
        {
            Character_model tem = new Character_model("priest");
            tem.setName("priest" + i);
            tem.setPosition(fromCoast.getEmptyPosition());
            tem.getOnCoast(fromCoast);
            fromCoast.getOnCoast(tem);
            team.Add(tem);
        }
        for (int i = 0; i < 3; i++)
        {
            Character_model tem = new Character_model("devil");
            tem.setName("devil" + i);
            tem.setPosition(fromCoast.getEmptyPosition());
            tem.getOnCoast(fromCoast);
            fromCoast.getOnCoast(tem);
            team.Add(tem);
        }
    }
예제 #2
0
 public void isClickChar(Character_model tem_char)
 {
     if (Move_model.can_move == 1)
     {
         return;
     }
     if (tem_char._isOnBoat())
     {
         Coast_model tem_coast;
         if (boat.getflag() == -1)
         {
             tem_coast = toCoast;
         }
         else
         {
             tem_coast = fromCoast;
         }
         boat.getOffBoat(tem_char.getName());
         tem_char.moveToPosition(tem_coast.getEmptyPosition());
         tem_char.getOnCoast(tem_coast);
         tem_coast.getOnCoast(tem_char);
     }
     else
     {
         Coast_model tem_coast2 = tem_char.getcoastmodel();
         if (boat.getEmptyIndex() == -1)
         {
             return;
         }
         if (boat.getflag() != tem_coast2.getflag())
         {
             return;
         }
         tem_coast2.getOffCoast(tem_char.getName());
         tem_char.moveToPosition(boat.getEmptyPosition());
         tem_char.getOnBoat(boat);
         boat.getOnBoat(tem_char);
     }
     user.if_win_or_not = checkGameOver();
 }
예제 #3
0
 public void setController(Character_model tem)
 {
     character = tem;
 }