Skip to content

Log Viewer doesn't work with input system #53

@Jacko123490

Description

@Jacko123490

I have imported the file into my project but the calls using the 'Input' namespace isn't supported with the Unity input system. I have implemented my own fixes to the code for my personal use fine but as I am just using PC this won't work for touch-based systems and my modified version won't detect if the game is using the input system. Despite this here are the steps I took to fix it for you to get started with:

All work is done in the Reporter.cs file.
Added 'using UnityEngine.InputSystem;' to the start of the file.
Modified the isGestureDone(), isDoubleClickDone(), getDownPos(), and getDrag() functions:
- Swapped, Input.GetMouseButtonDown/Up(0) with Mouse.current.leftButton.wasPressed/RelesedThisFrame
- Swapped, Input.GetMouseButton(0) with Mouse.current.leftButton.isPressed
- Swapped, all mose position calls with Mouse.current.position.ReadValue() (using .x and .y for float outputs)
- Deleted all the if IOS or Android platform calls in these functions to remove the conflicting function calls.

Let me know if you want to see the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions