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

Inject buttons for any MonoBehaviour inheritance to Inspector.

Discussion in 'Editor & General Support' started by olegkuzyk, Dec 1, 2017.

  1. olegkuzyk

    olegkuzyk

    Joined:
    Dec 2, 2015
    Posts:
    7
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,194
    AttributeReader looks like it'd be handy to have to get that to compile!
     
  3. olegkuzyk

    olegkuzyk

    Joined:
    Dec 2, 2015
    Posts:
    7
    Could you explain what do you mean? I googled AttributeReader and there is nothing.
     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,194
    You have it in the code you pasted:

    Code (csharp):
    1. var buttonMethods = AttributeReader.ReadMethods<ButtonAttribute>(target.GetType());
    But that's not a standard C# thing, so I guess you have it from somewhere?
     
  5. olegkuzyk

    olegkuzyk

    Joined:
    Dec 2, 2015
    Posts:
    7
    Damn it.
    Fixed the snippet.
    Thanks.
     
    Baste likes this.
  6. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,559
    You invoke the method without any args, but is there any validation that those methods don't in fact have any arguments ?