// Use this for initialization
    void Awake()
    {
        mInputKeyTimeDict = new Dictionary <KeyData, ValData>();

        mUsbHid = GetComponent <NemoUsbHid_HardScan>();
        mUsbHid.FuncHSThread_AddKeyPress += Func_InInvokeKeyEvent;
        mUsbHid.Evt_HSThread_FrameStart  += Handle_HSThread_Update;

        mKeyDataBuff = new KeyData();
        //mValBuff = new ValData();
        mDeleteKeyDataInUpdateLoop = new List <KeyValuePair <KeyData, ValData> >();


        mTimeIgnoreInputTick = TimeIgnoreInputMS * 10000;


        //
        //mKeyDataBuff.CtrllerIdx = 1;
        //mKeyDataBuff.InputKey = NemoUsbHid_HardScan.InputCmd.BtnA;
        //Debug.Log(mInputKeyTimeDict.TryGetValue(mKeyDataBuff, out mValBuff));
        //KeyData kd = new KeyData();
        //kd.CtrllerIdx = 1;
        //kd.InputKey = NemoUsbHid_HardScan.InputCmd.BtnA;
        //ValData vd = new ValData();
        //vd.KeyStateStart = vd.KeyStateLast = true;
        //vd.TimeStartDelayTrigger = System.DateTime.Now.Ticks;
        //mInputKeyTimeDict.Add(kd, vd);


        //mKeyDataBuff.CtrllerIdx = 2;
        //mKeyDataBuff.InputKey = NemoUsbHid_HardScan.InputCmd.BtnA;
        //Debug.Log(mInputKeyTimeDict.TryGetValue(mKeyDataBuff, out mValBuff));
    }
Ejemplo n.º 2
0
    void Start()
    {
        mLighttingTag = new bool[30];
        if (ArcIO == null)
        {
            ArcIO = GetComponent <NemoUsbHid_HardScan>();
            if (ArcIO == null)
            {
                Debug.LogError("ArcadeSinglePlayerTester初始化错误.");
            }
        }

        ArcIO.EvtKey += KeyEvent;
        ArcIO.EvtCtrlBoardStateChanged += Handle_CtrlBoardStateChanged;
        ArcIO.EvtOutCoinReflect        += OnOutCoin;
        ArcIO.EvtOutTicketReflect      += OnOutTicket;
        ArcIO.EvtInsertCoin            += OnInsertCoin;
        ArcIO.EvtHardwareInfo          += Hnalde_HardwareInfoRespon;
        ArcIO.EvtResultReadWrite       += Handle_ResultReadWrite;
        //ArcIO.EvtLackCoin += OnLackCoin;
        //ArcIO.EvtLackTicket += OnLackTicket;
        ArcIO.Open();
        if (ArcIO.IsOpen())
        {
            DebugLog("已连接");
        }
        else
        {
            DebugLog("未连接");
        }
    }
Ejemplo n.º 3
0
    bool Func_InInvokeKeyEvent(int ctrllerIdx, NemoUsbHid_HardScan.InputCmd key, bool keyState)
    {
        mKeyDataBuff.CtrllerIdx = ctrllerIdx;
        mKeyDataBuff.InputKey = key;

        //Debug.Log("Func_InInvokeKeyEvent keyState = " + keyState);

        if (mInputKeyTimeDict.TryGetValue(mKeyDataBuff, out mValBuff))
        {
            //Debug.Log("mInputKeyTimeDict.TryGetValue;");
            mValBuff.KeyStateLast = keyState;
        }
        else
        {
            KeyData kd = new KeyData();
            kd.CtrllerIdx = ctrllerIdx;
            kd.InputKey = key;

            ValData vd = new ValData();
            vd.KeyStateStart = vd.KeyStateLast = keyState;
            vd.TimeStartDelayTrigger = System.DateTime.Now.Ticks;

            mInputKeyTimeDict.Add(kd, vd);
            //Debug.Log("mInputKeyTimeDict.Add(kd, vd);");
        }

        return false;
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Awake()
    {
        mInputKeyTimeDict = new Dictionary<KeyData, ValData>();

        mUsbHid = GetComponent<NemoUsbHid_HardScan>();
        mUsbHid.FuncHSThread_AddKeyPress += Func_InInvokeKeyEvent;
        mUsbHid.Evt_HSThread_FrameStart += Handle_HSThread_Update;

        mKeyDataBuff = new KeyData();
        //mValBuff = new ValData();
        mDeleteKeyDataInUpdateLoop = new List<KeyValuePair<KeyData, ValData>>();

        mTimeIgnoreInputTick = TimeIgnoreInputMS * 10000;

        //
        //mKeyDataBuff.CtrllerIdx = 1;
        //mKeyDataBuff.InputKey = NemoUsbHid_HardScan.InputCmd.BtnA;
        //Debug.Log(mInputKeyTimeDict.TryGetValue(mKeyDataBuff, out mValBuff));
        //KeyData kd = new KeyData();
        //kd.CtrllerIdx = 1;
        //kd.InputKey = NemoUsbHid_HardScan.InputCmd.BtnA;
        //ValData vd = new ValData();
        //vd.KeyStateStart = vd.KeyStateLast = true;
        //vd.TimeStartDelayTrigger = System.DateTime.Now.Ticks;
        //mInputKeyTimeDict.Add(kd, vd);

        //mKeyDataBuff.CtrllerIdx = 2;
        //mKeyDataBuff.InputKey = NemoUsbHid_HardScan.InputCmd.BtnA;
        //Debug.Log(mInputKeyTimeDict.TryGetValue(mKeyDataBuff, out mValBuff));
    }
Ejemplo n.º 5
0
    void Start()
    {
        //mLighttingTag = new bool[30];
        if (ArcIO == null)
        {
            ArcIO = GetComponent<NemoUsbHid_HardScan>();
            ArcIO.Open();
            if (ArcIO == null)
                Debug.LogError("ArcadeSinglePlayerTester��ʼ������.");
        }

        //ArcIO.EvtKey += KeyEvent;
        //ArcIO.EvtCtrlBoardStateChanged += Handle_CtrlBoardStateChanged;
        //ArcIO.EvtOutCoinReflect += OnOutCoin;
        //ArcIO.EvtOutTicketReflect += OnOutTicket;
        //ArcIO.EvtInsertCoin += OnInsertCoin;
        ArcIO.EvtHardwareInfo += Hnalde_HardwareInfoRespon;
        ArcIO.EvtResultEditMCU += Handle_ResultEditMCU;

        //ArcIO.EvtLackCoin += OnLackCoin;
        //ArcIO.EvtLackTicket += OnLackTicket;
        DebugLog("������Ϸ˵��:  0:	�������� 1:�������� 2:�������� 3:ҡǮ�� 4:�������� 5:������ 6:������� 7:һ���� 8:һ����2 9:�����ֺ�");

        if (ArcIO.IsOpen())
        {
            ArcIO.RequestHardwareInfo();//����汾��Ϣ
            DebugLog("������");
        }
        else
            DebugLog("���");

        //HMACMD5 cryptor = new HMACMD5(System.Text.Encoding.ASCII.GetBytes("FX20120927YIDINGYAOCHANGAEF51FM2"));

        //byte[] challengeAnswer = cryptor.ComputeHash(System.BitConverter.GetBytes(123));
        //byte[] testAry = new byte[]{
        //    0,0,0,0,
        //    0,0,0,0,
        //    0,0,0,0,
        //    0,0,0,7B
        //};
        //byte[] challengeAnswer = cryptor.ComputeHash(System.Text.Encoding.ASCII.GetBytes("123456789A123456"));

        //Debug.Log(NemoUsbHid_HardScan.ByteArrayToString(challengeAnswer));
    }
Ejemplo n.º 6
0
    void Start()
    {
        mLighttingTag = new bool[30];
        if (ArcIO == null)
        {
            ArcIO = GetComponent<NemoUsbHid_HardScan>();
            if (ArcIO == null)
                Debug.LogError("ArcadeSinglePlayerTester��ʼ������.");
        }

        ArcIO.EvtKey += KeyEvent;
        ArcIO.EvtCtrlBoardStateChanged += Handle_CtrlBoardStateChanged;
        ArcIO.EvtOutCoinReflect += OnOutCoin;
        ArcIO.EvtOutTicketReflect += OnOutTicket;
        ArcIO.EvtInsertCoin += OnInsertCoin;
        ArcIO.EvtHardwareInfo += Hnalde_HardwareInfoRespon;
        ArcIO.EvtResultReadWrite += Handle_ResultReadWrite;
        //ArcIO.EvtLackCoin += OnLackCoin;
        //ArcIO.EvtLackTicket += OnLackTicket;
        ArcIO.Open();
        if (ArcIO.IsOpen())
        {
            DebugLog("������");
        }
        else
            DebugLog("���");
    }