Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (listenRoll)
        {
            if (phase == 1 && messageUI.getResult().getDone())
            {
                phase = 2;
            }

            if (phase == 2 && !uiManager.getResult().getDone() && messageUI.isClosed())
            {
                NPC           chara = (NPC)roundController.getCurrentRoundChar();
                RollDiceParam param = new RollDiceParam(chara.getAbilityInfo()[0]);
                uiManager.setRollDiceParam(param);
                uiManager.showRollDice();
            }
            else if (phase == 2 && uiManager.getResult().getDone())
            {
                rollValue = uiManager.getResult().getResult();
                phase     = 3;
            }
            else if (phase == 3 && !uiManager.isClosedPlane())
            {
                this.openEvent(rollValue);
            }
        }
    }
Example #2
0
    public void excuteLeaveRoomEvent(DoorInterface door, RoomInterface ri, Character chara)
    {
        //这个房间有没有离开事件
        eventI = ri.getRoomEvent(EventConstant.LEAVE_EVENT);

        //不为空有事件
        if (eventI != null)
        {
            Debug.Log("有离开事件");
            leaveExecuted = false;
            this.ri       = ri;
            this.chara    = chara;
            this.door     = door;
            phase         = 1;
            messageUI.getResult().setDone(false);
            showMessageUi(eventI.getEventBeginInfo(), eventI.getSelectItem());
        }
        else
        {
            //为空没有事件
            Debug.Log("没有离开事件");
            door.playerOpenDoorResult(true);
        }
    }