Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question InputActionAsset generate C# class need a new constructor with the parameter InputActionAsset.

Discussion in 'Input System' started by 479813005, Oct 5, 2021.

  1. 479813005

    479813005

    Joined:
    Mar 18, 2015
    Posts:
    58
    In my project,i use gererated class on game start.
    upload_2021-10-5_14-46-10.png
    And in some other position, i need check a action state,so i use InputActionReference refer from InputActionAsset .
    upload_2021-10-5_14-44-36.png
    The problem is gererated class instance not use InputActionAsset scriptObject.
    And there is no way to create an instance of the generated class via InputActionAsset scriptObject asset.

    In game,there are not same inputaction.
    InputActionReference's action is not enable.

    So, i need a constructor like this.
    upload_2021-10-5_14-52-58.png
    Then i can use same InputActionAsset scriptObject asset everywhere to resolve the problem.
     
    Last edited: Oct 5, 2021
    mitaywalle likes this.
  2. 479813005

    479813005

    Joined:
    Mar 18, 2015
    Posts:
    58
  3. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    245
    2023, still in TODO, no reviews on Pull Request...

    Screenshot_12.png
    Screenshot_13.png
     
  4. xprezio

    xprezio

    Joined:
    Sep 30, 2023
    Posts:
    1
    Xprez.io – The ultimate Presentation Solution
     
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,904
    Unity rarely takes on pull requests. And the Input System team is notoriously unresponsive an slow on every level.

    If you are interested, I have a solution to this problem, I wrote my own input codegen:
    https://github.com/LurkingNinja/com.lurking-ninja.input-codegen
    you will also need the codegen package as well in order this to work:
    https://github.com/LurkingNinja/com.lurking-ninja.codegen

    You can just install them in the package manager through the
    Install package from git url
    menu point.
     
  6. mitaywalle

    mitaywalle

    Joined:
    Jul 1, 2013
    Posts:
    245

    Thanks for suggestions. Yea, I understand about no pull request answers, but it is in their own TODO comments, feel dump.

    Thank you for links to your solution, but I wanna have actualized version of code generator safe for input system package updates.

    There is way to fork package from Github needle, apply pull request there, and after package updates make git rebase.

    But this is not easy way

    Best way - that it would built-in. That's I why wrote here