Beispiel #1
0
    public Dictionary <int, GameObject> cubes_Blocks = new Dictionary <int, GameObject>();    //for Dynamic create BlockID

    // Use this for initialization
    void Start()
    {
        RFIB = new RFIBricks_Cores(ReaderIP, ReaderPower, Sensitive, EnableAntenna, Flag_ToConnectTheReade);

        //RFIB.setSerialcomPort("COM3");


        RFIB.setShowSysMesg(false);
        RFIB.setShowReceiveTag(false);
        RFIB.setShowDebugMesg(false);
        //RFIB.setSysTagBased("7428 0000");
        RFIB.setSysTagBased("2250 0000");
        RFIB.setAllowBlockType(AllowBlockType);

        //[OPTIMIZATION]
        RFIB.setRefreshTime(300);
        RFIB.setDisappearTime(300);
        RFIB.setDelayForReceivingTime(200);

        RFIB.Num_Allow_LosslyStack = 1;
        RFIB.startReceive();

        if (Flag_AddPreStackOnce)
        {
            RFIB.setPreStackOrders(PreStackOrders);
        }

        DrawBoard();
        setBoardIDandSpecialMaterialBlcok();
    }
Beispiel #2
0
    readonly int delayForReceivingTime = 200;            // 清空之後停多久才收id

    #endregion

    void Start()
    {
        #region Set RFIB Parameter
        RFIB = new RFIBricks_Cores(ReaderIP, ReaderPower, Sensitive, EnableAntenna, Flag_ToConnectTheReade);
        RFIB.setShowSysMesg(showSysMesg);
        RFIB.setShowReceiveTag(showReceiveTag);
        RFIB.setShowDebugMesg(showDebugMesg);

        RFIB.setSysTagBased(sysTagBased);
        RFIB.setAllowBlockType(RFIBParameter.AllowBlockType);

        RFIB.setRefreshTime(refreshTime);
        RFIB.setDisappearTime(disappearTime);
        RFIB.setDelayForReceivingTime(delayForReceivingTime);

        // 開始接收ID前要將地板配對
        BoardMapping();

        RFIB.startReceive();
        RFIB.startToBuild();
        RFIB.printNoiseIDs();

        #endregion

        tagSensing  = new Dictionary <string, bool>();
        tagMissTime = new Dictionary <string, int>();

        foreach (var dic in gameParameter.characterDic)
        {
            tagSensing.Add(dic.Key, false);
            tagMissTime.Add(dic.Key, 0);
        }
    }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        model = GameModel.GetInstance();
        InitPlantTable();

        RFIB = new RFIBricks_Cores(ReaderIP, ReaderPower, Sensitive, EnableAntenna, Flag_ToConnectTheReade);
        //RFIB.setSerialcomPort("COM3"); //arduino connect
        RFIB.setShowSysMesg(true);
        RFIB.setShowReceiveTag(true);
        RFIB.setShowDebugMesg(true);

        RFIB.setSysTagBased("8940 0000");
        RFIB.setAllowBlockType(AllowBlockType);

        RFIB.setRefreshTime(1000);          //clear beffer
        RFIB.setDisappearTime(600);         //id 消失多久才會的消失
        RFIB.setDelayForReceivingTime(400); //清空之後停多久才收id

        BoardMapping();                     // 開始接收ID前要將地板配對

        RFIB.startReceive();

        RFIB.startToBuild();
        RFIB.printNoiseIDs();

        updateFlag = new bool[5, 9];
        errorMap   = new bool[5, 9];
        for (int i = 0; i < 5; i++)
        {
            for (int j = 0; j < 9; j++)
            {
                updateFlag[i, j] = false;
                errorMap[i, j]   = false;
            }
        }

        lastIdStack   = new string[5, 9, 3];
        lastDirection = new string[5, 9, 3];
        lastPlant     = new int[5, 9, 3];
        for (int i = 0; i < 5; i++)
        {
            for (int j = 0; j < 9; j++)
            {
                for (int k = 0; k < 3; k++)
                {
                    lastIdStack[i, j, k]   = "0000";
                    lastDirection[i, j, k] = "000000";
                    lastPlant[i, j, k]     = 0;
                }
            }
        }
    }
Beispiel #4
0
    void Start()
    {
        #region Set RFIB Parameter
        RFIB = new RFIBricks_Cores(ReaderIP, ReaderPower, Sensitive, EnableAntenna, Flag_ToConnectTheReade);
        RFIB.setShowSysMesg(showSysMesg);
        RFIB.setShowReceiveTag(showReceiveTag);
        RFIB.setShowDebugMesg(showDebugMesg);

        RFIB.setSysTagBased(sysTagBased);
        RFIB.setAllowBlockType(RFIBParameter.AllowBlockType);

        RFIB.setRefreshTime(refreshTime);
        RFIB.setDisappearTime(disappearTime);
        RFIB.setDelayForReceivingTime(delayForReceivingTime);

        // 開始接收ID前要將地板配對
        BoardMapping();

        RFIB.startReceive();
        RFIB.startToBuild();
        RFIB.printNoiseIDs();

        #endregion

        blockId    = new string[RFIBParameter.stageCol, RFIBParameter.stageRow, RFIBParameter.maxHight];
        touchBlock = new bool[RFIBParameter.touchCol, RFIBParameter.touchRow];

        for (int i = 0; i < RFIBParameter.stageCol; i++)
        {
            for (int j = 0; j < RFIBParameter.stageRow; j++)
            {
                for (int k = 0; k < RFIBParameter.maxHight; k++)
                {
                    blockId[i, j, k] = "0000";
                }
            }
        }
        for (int i = 0; i < RFIBParameter.touchCol; i++)
        {
            for (int j = 0; j < RFIBParameter.touchRow; j++)
            {
                touchBlock[i, j] = false;
            }
        }
    }