示例#1
0
 void Update()
 {
     //if (Input.GetKeyDown(KeyCode.W))
     //{
     //    Debug.Log("您按下了W键");
     //    txtResult.text = "W";
     //}
     //解决键盘被输入法劫持问题
     Win32Help.SetImeEnable(false);
     EventHandler.getKeyDownCode(majiangPlane);
 }
示例#2
0
 public static void GameStart()
 {
     Debug.Log("GameStart!");
     Win32Help.SetImeEnable(false);
     SceneManager.LoadScene(0);
 }
示例#3
0
    void Start()
    {
        //解决键盘被输入法劫持问题
        Win32Help.SetImeEnable(false);
        //初始化所求值
        string[] outDoor = { "1234", "2341", "4123" };
        string[] endDoor = { "4321", "3214", "1423" };
        string[] banker  = { "1224", "2124", "1122" };

        dicResult.Add("outDoor", outDoor);
        dicResult.Add("endDoor", endDoor);
        dicResult.Add("banker", banker);


        //资源初始化
        MaJiangResInit();

        //指定固定分辨率
        Screen.SetResolution(1024, 768, false);
        //移动面板
        movePlane    = GameObject.Find("Canvas/MovePanel");
        txtMoveCount = GameObject.Find("Canvas/txtMoveCount").GetComponent <Text>();
        //结果
        txtResult    = GameObject.Find("Canvas/txtResult").GetComponent <Text>();
        txtOriginal  = GameObject.Find("txtOriginal").GetComponent <Text>();
        chkAuto      = GameObject.Find("Canvas/chkAuto").GetComponent <Toggle>();
        chkAuto.isOn = false;

        GameObject btnChange = GameObject.Find("btnChange");

        btn0 = btnChange.GetComponent <Button>();
        btn0.onClick.AddListener(delegate()
        {
            this.OnClick(btnChange);
        });

        GameObject btnQuit = GameObject.Find("btnQuit");
        Button     btn1    = btnQuit.GetComponent <Button>();

        btn1.onClick.AddListener(delegate()
        {
            this.OnClick(btnQuit);
        });

        GameObject btnSquat = GameObject.Find("btnSquat");
        Button     btn2     = btnSquat.GetComponent <Button>();

        btn2.onClick.AddListener(delegate()
        {
            this.OnClick(btnSquat);
        });

        GameObject btnFlat = GameObject.Find("btnFlat");
        Button     btn3    = btnFlat.GetComponent <Button>();

        btn3.onClick.AddListener(delegate()
        {
            this.OnClick(btnFlat);
        });

        GameObject btnJump = GameObject.Find("btnJump");
        Button     btn4    = btnJump.GetComponent <Button>();

        btn4.onClick.AddListener(delegate()
        {
            this.OnClick(btnJump);
        });
        //左移一位
        GameObject btnLeftMove = GameObject.Find("btnLeftMove");
        Button     btn5        = btnLeftMove.GetComponent <Button>();

        btn5.onClick.AddListener(delegate()
        {
            this.OnClick(btnLeftMove);
        });
        //右移一位
        GameObject btnRightMove = GameObject.Find("btnRightMove");
        Button     btn6         = btnRightMove.GetComponent <Button>();

        btn6.onClick.AddListener(delegate()
        {
            this.OnClick(btnRightMove);
        });
        //重置
        GameObject btnReset = GameObject.Find("btnReset");

        btn7 = btnReset.GetComponent <Button>();
        btn7.onClick.AddListener(delegate()
        {
            this.OnClick(btnReset);
        });

        chkInput = GameObject.Find("chkInput").GetComponent <Toggle>();
        chkInput.onValueChanged.AddListener((bool value) => EventHandler.OnToggleClick(chkInput, value));
        chkInput.isOn = true;

        majiangPlane = GameObject.Find("Canvas/Plane");
        //生成牌
        GenerateMaJiang();
        if (chkInput.isOn)
        {
            //禁用切牌按钮
            btn0.interactable = false;
            listMajiangAuto   = listMajiangManual;
        }
        InitLoadMaJing(movePlane);
    }