예제 #1
0
        protected void HandleGamepadTimingOut(SocketIOEvent e)
        {
            SGUpdateMsg gamepadTimingOut = new SGUpdateMsg(e.data);

            Debug.Log("Gamepad " + gamepadTimingOut.SGID + " Timing out");
            SocketGamepad gamepad = GetGamepad(gamepadTimingOut.SGID);

            OnGamepadTimingOut(gamepad);
        }
예제 #2
0
        //Change Input array to Dictionary of named delegates instead of an array of 20 floats
        protected void HandleGamepadUpdate(SocketIOEvent e)
        {
            SGUpdateMsg UpdateMsg = new SGUpdateMsg(e.data);

            //Debug.Log("Gamepad Update Received for " + UpdateMsg.SGID.ToString());
            if (UpdateMsg.SGID > -1)
            {
                SocketGamepad gamepad = GetGamepad(UpdateMsg.SGID);
                if (gamepad == null)
                {
                    Debug.Log("Controller " + UpdateMsg.SGID + " sending Updates without handshake!");
                }
                else
                {
                    gamepad.InputData = UpdateMsg.Data;
                    OnUpdateGamepad(gamepad);
                }
            }
            else
            {
                //Hack Attempt?
                Debug.LogError("STOP IT, I'M NOT A DOCTOR!!");
            }
        }
예제 #3
0
 /// <summary>
 /// Used for local testing, injects a manually created SGUpdateMsg
 /// into the system as if it were from the Socket Gamepad Manager
 /// </summary>
 /// <param name="updateMsg"></param>
 public void InjectGamepadUpdate(SGUpdateMsg updateMsg)
 {
     updateMsg.Serialize();
     HandleGamepadUpdate(new SocketIOEvent("SGUpdateMsg", updateMsg));
 }