Exemplo n.º 1
0
    void Update()
    {
        Joystick.DPadDirection curDPadDirection = joystick.GetDPadDirection();
        Debug.Log("Direction: " + curDPadDirection.ToString());

        Vector3 moveVector = (transform.right * joystick.Horizontal + transform.forward * joystick.Vertical).normalized;

        transform.Translate(moveVector * moveSpeed * Time.deltaTime);
    }
Exemplo n.º 2
0
 public JoystickState(JoystickState state)
 {
     this.direction = state.direction;
     this.state     = state.state;
 }