Exemple #1
0
 public void CharacterClicked(MySpace.CharacterController characterCtr)
 {
     if (userGUI.status == -1 || userGUI.status == 1)
     {
         return;
     }
     if (characterCtr.character.OnBoat)
     {
         CoastController tempCoast = (boatCtr.boat.location == Location.right ? rightCoastCtr : leftCoasrCtr);
         boatCtr.GetOffBoat(characterCtr.character.Name);
         characterCtr.MoveTo(tempCoast.GetEmptyPosition());
         characterCtr.GetOnCoast(tempCoast);
         tempCoast.GetOnCoast(characterCtr);
     }
     else
     {
         CoastController tempCoast = characterCtr.character.coast;
         if (tempCoast.coast.location != boatCtr.boat.location)
         {
             return;                                                    //不再同一边的人上不去
         }
         if (boatCtr.GetEmptyIndex() == -1)
         {
             return;                               //船上没人
         }
         tempCoast.GetOffCoast(characterCtr.character.Name);
         characterCtr.MoveTo(boatCtr.GetEmptyPosition());
         characterCtr.GetOnBoat(boatCtr);
         boatCtr.GetOnBoat(characterCtr);
     }
     userGUI.status = CheckGameOver();
 }
Exemple #2
0
    public void CharacterClicked(MySpace.CharacterController characterCtr)
    {
        if (judgeCtr.Flag == -1 || judgeCtr.Flag == 1)
        {
            return;                                            //lock
        }
        if (characterCtr.character.OnBoat)
        {
            CoastController tempCoast = (boatCtr.boat.location == Location.right ? rightCoastCtr : leftCoasrCtr);
            boatCtr.GetOffBoat(characterCtr.character.Name);
            //characterCtr.MoveTo(tempCoast.GetEmptyPosition());
            actionController.CharacterMove(characterCtr, tempCoast.GetEmptyPosition());

            characterCtr.GetOnCoast(tempCoast);
            tempCoast.GetOnCoast(characterCtr);
        }
        else
        {
            CoastController tempCoast = characterCtr.character.coast;
            if (tempCoast.coast.location != boatCtr.boat.location)
            {
                return;
            }
            if (boatCtr.GetEmptyIndex() == -1)
            {
                return;
            }

            tempCoast.GetOffCoast(characterCtr.character.Name);
            //characterCtr.MoveTo(boatCtr.GetEmptyPosition());
            actionController.CharacterMove(characterCtr, boatCtr.GetEmptyPosition());
            //Debug.Log("boat" + boatCtr.GetEmptyPosition());
            characterCtr.GetOnBoat(boatCtr);
            boatCtr.GetOnBoat(characterCtr);
        }
        userGUI.status = judgeCtr.judgeGameOver();
    }