예제 #1
0
    void OnGUI()
    {
        GUI.skin.button.fontSize = GUI.skin.textArea.fontSize = 14;
        width  = Screen.width / 12;
        height = Screen.height / 12;

        if (state.getMessage() != "")
        {
            if (GUI.Button(new Rect(castw(2f), casth(6f), width, height), state.getMessage()))
            {
                action.restart();
            }
        }
        else
        {
            if (GUI.RepeatButton(new Rect(10, 10, 100, 40), "Help"))
            {
                GUI.TextArea(new Rect(10, 60, 750, 100), scene.gameRule);
            }
            else if (!state.isMoving())
            {
                if (GUI.Button(new Rect(castw(2f), casth(6f), width, height), "Next"))
                {
                    StartCoroutine(action.nextmove());
                }
                //if (GUI.Button(new Rect(castw(2f), casth(6f), width, height), "Go")) action.moveBoat();
                //if (GUI.Button(new Rect(castw(10.5f), casth(4f), width, height), "恶魔On")) action.devilSOnB();
                //if (GUI.Button(new Rect(castw(4.29f), casth(4f), width, height), "牧师On")) action.priestSOnB();
                //if (GUI.Button(new Rect(castw(1.06f), casth(4f), width, height), "恶魔On")) action.devilEOnB();
                //if (GUI.Button(new Rect(castw(1.26f), casth(4f), width, height), "牧师On")) action.priestEOnB();
                //if (GUI.Button(new Rect(castw(2.5f), casth(1.3f), width, height), "左侧Off")) action.offBoatL();
                //if (GUI.Button(new Rect(castw(1.6f), casth(1.3f), width, height), "右侧Off")) action.offBoatR();
            }
        }
    }
예제 #2
0
    void OnGUI()
    {
        GUI.skin.button.fontSize = GUI.skin.textArea.fontSize = 20;
        width  = Screen.width / 12;
        height = Screen.height / 12;

        if (state.getMessage() != "")
        {
            if (GUI.Button(new Rect(castw(2f), casth(6f), width, height), state.getMessage()))
            {
                action.restart();
            }
        }
        else
        {
            if (GUI.RepeatButton(new Rect(10, 10, 100, 40), "Help"))
            {
                GUI.TextArea(new Rect(10, 60, 750, 100), scene.getBaseCode().gameRule);
            }
            else if (!state.isMoving())
            {
                if (GUI.Button(new Rect(castw(2f), casth(6f), width, height), "开船"))
                {
                    action.moveBoat();
                }
                if (GUI.Button(new Rect(castw(10.5f), casth(4f), width, height), "恶魔上船"))
                {
                    action.devilSOnB();
                }
                if (GUI.Button(new Rect(castw(4.29f), casth(4f), width, height), "牧师上船"))
                {
                    action.priestSOnB();
                }
                if (GUI.Button(new Rect(castw(1.06f), casth(4f), width, height), "恶魔上船"))
                {
                    action.devilEOnB();
                }
                if (GUI.Button(new Rect(castw(1.26f), casth(4f), width, height), "牧师上船"))
                {
                    action.priestEOnB();
                }
                if (GUI.Button(new Rect(castw(2.5f), casth(1.3f), width, height), "左侧下船"))
                {
                    action.offBoatL();
                }
                if (GUI.Button(new Rect(castw(1.6f), casth(1.3f), width, height), "右侧下船"))
                {
                    action.offBoatR();
                }
            }
        }
    }