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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Feedback Overriding StandaloneInputModule methods

Discussion in 'UGUI & TextMesh Pro' started by ryan-at-melcher, Mar 12, 2021.

  1. ryan-at-melcher

    ryan-at-melcher

    Joined:
    Oct 22, 2018
    Posts:
    14
    Some methods in StandaloneInputModule would be nice to override but they are not marked virtual. Interestingly, the function I was hoping to override, ProcessTouchPress, mentions that it can be overridden in derived classes but is itself not virtual. It seems the idea was to allow for this type of extension but it was never exposed.

    StandaloneInputModule.cs:
    Code (CSharp):
    1.  
    2. /// <remarks>
    3. /// This method can be overridden in derived classes
    4. /// to change how touch press events are handled.
    5. /// </remarks>
    6. protected void ProcessTouchPress(PointerEventData pointerEvent,
    7.                                  bool pressed,
    8.                                  bool released)
    9. {
    10.     // ...
    11. }
    12.  
    Is this something that will be changed in the future?
     
    stream_in_space_ likes this.
  2. CodeRonnie

    CodeRonnie

    Joined:
    Oct 2, 2015
    Posts:
    338
    I totally agree. I am not sure why they would indicate that you can override these parts of the UI system to customize the way input is handled, but not actually implement it that way after all this time.
     
    stream_in_space_ likes this.
  3. stream_in_space_

    stream_in_space_

    Joined:
    Dec 22, 2015
    Posts:
    12
    I'm also very frustrated, I spent a few hours and still do not understand how to override it, and that remark looks like a bad joke. I dont want to edit all button's scripts in my huge project :(