Example #1
0
    //protected void Start()
    //{
    //    base.Start();
    //    if (localPlayerAuthority)
    //    {
    //        controller = GI.ControllerManager.Instance.RequestGamepad();
    //    }
    //}

    // Update is called once per frame
    void Update()
    {
        //TODO: All controllers have local player authority so its getting a bunch of gamepads

        if (registerGamePad.Enter())
        {
            if (isLocalPlayer)
            {
                Logger.Log("Controller " + ID + " is LocalPlayer");
                controller = GI.ControllerManager.Instance.RequestGamepad();
            }
            else
            {
                Logger.Log("Controller " + ID + "is not LocalPlayer");
            }
        }

        if (isLocalPlayer)
        {
            xAxis = controller.Stick.Left.X;
            yAxis = controller.Stick.Left.Y;
            Debug.Log("Local Controller: " + ID + " x:" + xAxis + ", y: " + yAxis);
        }
        else
        {
            Debug.Log("Controller: " + ID + " x:" + xAxis + ", y: " + yAxis);
        }
    }
Example #2
0
 public Trigger(GamePadWrapper gamePadWrapper)
 {
     this.gamePadWrapper = gamePadWrapper;
 }
Example #3
0
 public Stick(GamePadWrapper gamePadWrapper)
 {
     this.gamePadWrapper = gamePadWrapper;
 }