Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up now.
    Dismiss Notice

Bug try to Script Add InputSystemUIInputModule and ActionAsset Thus bug

Discussion in 'Input System' started by ftianf, Oct 20, 2020.

  1. ftianf


    Oct 19, 2020
    Problem Description:
    When I try in AddComponent<InputSystemUIInputModule>()
    After changing the InputActionReference like "Point", the UnityEngine.EventSystems.IPointerEnterHandler class that inherits this interface cannot take effect. have to
    Inputsystem.enabled = false;
    Inputsystem.enabled = true;
    And in this case, the value is not successfully displayed in the editor panel.
    First and foremost, is this a bug?Or because of my wrong use
    Try Debug:
    I found that although the SwapAction function in the InputActionReference (like Point) component in all InputSystemUIInputModule added a callback, but only HookActions();EnableAllActions(); can make the click UI respond after the two functions are called, so I added this under the SwapAction function Two functions.

    In order to solve the problem that the Editor Panel does not display, I tried to understand InputSystemUIInputModuleEditor, but I don't know any way to associate the script itself with the editor script (only the editor script can be associated with the script ([CustomEditor])). So I added an Aciton, when InputActionReference is assigned, it will trigger the function assigned in the editor.

    But after solving it, I found that it caused a new bug
    When I cancel the function or disable the script through the editor panel, the UI response will still be triggered.
    When the editor script is not selected, nothing in the Editor script itself will be called, and the callback function will not be triggered. Will not respond in the correct function.

    My native language is not English.
    I changed the script
    InputSystemUIInputModuleEditor and InputSystemUIInputModule。tryfix.unitypackage
    ControlGroup Description Did have this problem 。ControlGroup.unitypackage
    RunNeed Addressables Package。SetAddressablePath。and look InputSystemAddScript.Script

    Attached Files: