Exemplo n.º 1
0
    public void ObjectIsClicked(GameObjects Objects)    //人物被点击事件
    {
        if (FCActionManager.Complete == SSActionEventType.Started)
        {
            return;
        }
        if (Objects.isOnBoat())         //对象在船上
        {
            CoastController whichCoast;
            if (boat.get_State() == -1)
            { // to->-1; from->1
                whichCoast = toCoast;
            }
            else
            {
                whichCoast = fromCoast;
            }

            boat.GetOffBoat(Objects.getName());                                      //下船,操作船对象
            FCActionManager.GameObjectsMove(Objects, whichCoast.getEmptyPosition()); //移动到空位置
            Objects.getOnCoast(whichCoast);                                          //登陆,操作人物对象
            whichCoast.getOnCoast(Objects);                                          //登陆,操作岸对象
        }
        else  //对象在岸上
        {
            Debug.Log("On Coast!");
            CoastController whichCoast = Objects.getCoastController(); // obejects on coast

            if (boat.getEmptyIndex() == -1)
            {
                return;
            }

            if (whichCoast.get_State() != boat.get_State())   // boat is not on the side of character
            {
                return;
            }

            whichCoast.getOffCoast(Objects.getName());                         //下岸,操作岸对象
            FCActionManager.GameObjectsMove(Objects, boat.getEmptyPosition()); //移动
            Objects.getOnBoat(boat);                                           //上船,操作人物对象
            boat.GetOnBoat(Objects);                                           //上船,操作船对象
        }
        // UserGUI.SetState = Check();
        UserGUI.SetState = judge.CheckGameState();
    }
Exemplo n.º 2
0
 public int getGameState()
 {
     return(judge.CheckGameState());
 }