Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.

    Read our full announcement for more information and let us know if you have any questions.

[Suggestion] Rename Button.onClick to Button.onSubmit

Discussion in 'UGUI & TextMesh Pro' started by Senshi, Aug 26, 2014.

  1. Senshi


    Oct 3, 2010

    I'm currently working on a character selection screen where the user controls a grid-based cursor controlled by key input, instead of a mouse. It took me a bit to figure out that I can just add my OnSubmit() delegate to a Button's onClick property, as I assumed it was specific for (pointer) clicks, essentially being a shorthand for EventTriggerType.PointerClick. Renaming it to onSubmit would also make it more consistent with InputField (and possibly others? I haven't checked.).

    hichanbis likes this.