Search Unity

Idea: Targetting static unity methods from Event Handlers

Discussion in 'UGUI & TextMesh Pro' started by senritsu, Aug 22, 2014.

  1. senritsu

    senritsu

    Joined:
    Dec 12, 2012
    Posts:
    37
    Inspired by something that came up on reddit for the minimal amount of work required to hook up something like Application.Quit() to the new GUI, i have a question:

    Would it be possible (and sensible?) to allow static unity classes as targets of events when no explicit target GameObject is selected?

    For example you make a button, leave the target box empty, and select Application.Quit() from the dropdown. Or you target things like QualitySettings directly. For simple things that usually consist of only one method call or property change this would eliminate the need to create a component wrapper for those methods/properties.
     
    User340 likes this.
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Yea, but that would be one enormous list!
     
  3. senritsu

    senritsu

    Joined:
    Dec 12, 2012
    Posts:
    37
    Sorting it into multiple Levels like it does for different components at the moment could alleviate some of that, but yeah, i agree :D