예제 #1
0
    public void KeyPressed()
    {
        GetKey("1", "8940 0000 3333 0000 0001");
        GetKey("2", "8940 0000 3333 0001 0001");
        GetKey("3", "8940 0000 3333 0002 0001");
        GetKey("4", "8940 0000 3333 0003 0001");
        GetKey("5", "8940 0000 3333 0004 0001");
        GetKey("6", "8940 0000 3333 0005 0001");
        GetKey("7", "8940 0000 3333 0006 0001");
        GetKey("8", "8940 0000 3333 0007 0001");
        GetKey("9", "8940 0000 3333 0008 0001");

        GetKey("q", "8940 0000 3333 0011 0001");
        GetKey("w", "8940 0000 3333 0012 0001");
        GetKey("e", "8940 0000 3333 0013 0001");

        #region Information
        if (Input.GetKeyUp(";"))
        {
            string[] tags = RFIB.GetTags();
            for (int i = 0; i < tags.Length; i++)
            {
                Debug.Log(tags[i]);
            }
        }
        if (Input.GetKeyUp("."))
        {
            RFIB.printAllReceivedIDs();
            RFIB.printNoiseIDs();
        }

        #endregion
    }
예제 #2
0
    // 下面這個function就是來偵測地板上方堆了幾個方塊的。
    //private int GetPositionHeight(int X, int Y)
    //{
    //    int MaxHeight = 0;

    //    foreach (int BlockID_intType in RFIB.StackedOrders3D.Keys)
    //    {
    //        if (RFIB.StackedOrders3D[BlockID_intType][0] == X && RFIB.StackedOrders3D[BlockID_intType][1] == Y)
    //        {
    //            if (RFIB.StackedOrders3D[BlockID_intType][2] > MaxHeight)
    //                MaxHeight = RFIB.StackedOrders3D[BlockID_intType][2];
    //        }
    //    }

    //    if (MaxHeight >= 4)
    //        MaxHeight = 4;
    //    return MaxHeight;
    //}

    #endregion

    // 系統編號 此欄空白 方塊種類 編號+上下 方向
    // 9999 0101 就是 (0, 0)
    // 9999 0203 就是 (1, 2)
    public void KeyPressed()
    {
        if (Input.GetKeyDown("1"))
        {
            ChangeTags("8940 0000 9999 0302 0001", "8940 0000 7101 4501 0001");
        }
        if (Input.GetKeyDown("2"))
        {
            ChangeTags("8940 0000 7101 4503 0001", "8940 0000 7101 4601 0001");
        }
        if (Input.GetKeyDown("3"))
        {
            ChangeTags("8940 0000 7101 4603 0001", "8940 0000 7101 4701 0001");
        }
        if (Input.GetKeyDown("4"))
        {
            ChangeTags("8940 0000 9999 0501 0001", "8940 0000 8601 5401 0001");
        }
        if (Input.GetKeyDown("5"))
        {
            ChangeTags("8940 0000 8601 5403 0001", "8940 0000 7101 5501 0001");
        }
        if (Input.GetKeyDown("6"))
        {
            ChangeTags("8940 0000 9999 0206 0001", "8940 0000 9101 5801 0001");
        }
        if (Input.GetKeyDown("7"))
        {
            ChangeTags("8940 0000 9101 5803 0001", "8940 0000 9601 5901 0001");
        }
        if (Input.GetKeyDown("8"))
        {
            touchHandler.touchSensing[14] = true;
        }
        if (Input.GetKeyUp("8"))
        {
            touchHandler.touchSensing[14] = false;
        }

        #region Information
        if (Input.GetKeyUp(";"))
        {
            string[] tags = RFIB.GetTags();
            for (int i = 0; i < tags.Length; i++)
            {
                Debug.Log(tags[i]);
            }
        }
        if (Input.GetKeyUp("."))
        {
            RFIB.printAllReceivedIDs();
            RFIB.printNoiseIDs();
        }

        #endregion
    }
예제 #3
0
    public void KeyPressed()
    {
        if (Input.GetKeyUp("0"))
        {
            ChangeTestTag("8940 0000 3333 0004 0012");
        }
        if (Input.GetKeyUp("1"))
        {
            ChangeTestTag("8940 0000 3333 0005 0012");
        }
        if (Input.GetKeyUp("2"))
        {
            ChangeTestTag("8940 0000 1111 0002 0001");
        }
        if (Input.GetKeyUp("3"))
        {
            ChangeTestTag("8940 0000 1111 0003 0001");
        }
        if (Input.GetKeyUp("4"))
        {
            ChangeTestTag("8940 0000 1111 0004 0001");
        }
        if (Input.GetKeyUp("5"))
        {
            ChangeTestTag("8940 0000 1111 0005 0001");
        }
        if (Input.GetKeyUp("6"))
        {
            ChangeTestTag("8940 0000 1111 0006 0001");
        }

        #region Information
        if (Input.GetKeyUp(";"))
        {
            string[] tags = RFIB.GetTags();
            for (int i = 0; i < tags.Length; i++)
            {
                Debug.Log(tags[i]);
            }
        }
        if (Input.GetKeyUp("."))
        {
            RFIB.printAllReceivedIDs();
            RFIB.printNoiseIDs();
        }

        #endregion
    }
예제 #4
0
    public void KeyPressed()
    {
        if (mode == 0)
        {
            #region Row
            GetKey("1", "8940 0000 2222 0408 0001");
            GetKey("2", "8940 0000 2222 0407 0001");
            GetKey("3", "8940 0000 2222 0406 0001");
            GetKey("4", "8940 0000 2222 0405 0001");
            GetKey("5", "8940 0000 2222 0404 0001");
            GetKey("6", "8940 0000 2222 0403 0001");
            GetKey("7", "8940 0000 2222 0402 0001");
            GetKey("8", "8940 0000 2222 0401 0001");
            GetKey("9", "8940 0000 2222 0400 0001");

            #endregion

            #region Col
            GetKey("q", "8940 0000 2222 0004 0001");
            GetKey("w", "8940 0000 2222 0104 0001");
            GetKey("e", "8940 0000 2222 0204 0001");
            GetKey("r", "8940 0000 2222 0304 0001");
            GetKey("t", "8940 0000 2222 0404 0001");
            GetKey("y", "8940 0000 2222 0504 0001");
            GetKey("u", "8940 0000 2222 0604 0001");
            GetKey("i", "8940 0000 2222 0704 0001");
            GetKey("o", "8940 0000 2222 0804 0001");

            #endregion

            #region Line
            GetKey("a", "8940 0000 2222 0708 0001");
            GetKey("s", "8940 0000 2222 0707 0001");
            GetKey("d", "8940 0000 2222 0706 0001");
            GetKey("f", "8940 0000 2222 0705 0001");
            GetKey("h", "8940 0000 2222 0704 0001");
            GetKey("j", "8940 0000 2222 0604 0001");
            GetKey("k", "8940 0000 2222 0504 0001");
            GetKey(",", "8940 0000 2222 0404 0001");
            GetKey("m", "8940 0000 2222 0403 0001");
            GetKey("n", "8940 0000 2222 0402 0001");
            GetKey("b", "8940 0000 2222 0401 0001");
            GetKey("v", "8940 0000 2222 0301 0001");
            GetKey("c", "8940 0000 2222 0201 0001");
            GetKey("x", "8940 0000 2222 0101 0001");
            GetKey("z", "8940 0000 2222 0001 0001");

            #endregion
        }
        else if (mode == 1)
        {
            #region two
            GetKey("1", "8940 0000 2222 0005 0001");
            GetKey("2", "8940 0000 2222 0105 0001");
            GetKey("3", "8940 0000 2222 0205 0001");
            GetKey("4", "8940 0000 2222 0204 0001");
            GetKey("5", "8940 0000 2222 0203 0001");
            GetKey("6", "8940 0000 2222 0103 0001");
            GetKey("t", "8940 0000 2222 0003 0001");
            GetKey("r", "8940 0000 2222 0002 0001");
            GetKey("e", "8940 0000 2222 0001 0001");
            GetKey("w", "8940 0000 2222 0000 0001");
            GetKey("q", "8940 0000 2222 0100 0001");
            GetKey("q", "8940 0000 2222 0200 0001");

            #endregion
        }

        if (Input.GetKeyDown("space"))
        {
            mode++;
        }

        #region Information
        if (Input.GetKeyUp(";"))
        {
            string[] tags = RFIB.GetTags();
            for (int i = 0; i < tags.Length; i++)
            {
                Debug.Log(tags[i]);
            }
        }
        if (Input.GetKeyUp("."))
        {
            RFIB.printAllReceivedIDs();
            RFIB.printNoiseIDs();
        }

        #endregion
    }