Example #1
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();
    }