Search Unity

Class inside class are not show in custom editor?

Discussion in 'Immediate Mode GUI (IMGUI)' started by LazyDog_Rich, Aug 12, 2016.

  1. LazyDog_Rich

    LazyDog_Rich

    Joined:
    Apr 27, 2014
    Posts:
    70
    Hi, I just started on this of custom editor and property drawer. And I dont know what I'm doing wrong

    I make a class "events" and made a custom editor for it. "events" use other classes has parameters.

    Now if I try to use "events" has a public parameter inside another class, all the custom editor is not show.

    This is how it looks "events" with custom editor:


    When I remove the monobehavior and make this calss serializable, and use like pulic Events events looks like this:


    All the custom editor is gone.

    -------------------------

    Then, I try to remake all the custom editor, but for "EventsManager" instead that for "Events" but I cant find the properties inside "Events" to make custom of them.

    Here I left the codes hopefull someone can tell me what I'm doing wrong:

    Events: http://paste.ofcode.org/35FADtsve8V53w5vYmnSr8E
    Custom Editor: http://paste.ofcode.org/9x2ZPdBy4gdaUMZ35mkG4A
    http://paste.ofcode.org/rkNb4PjpyhwSrNJL9awmkt

    I need to use public events to make them an array, and have all the events inside a single class.
    Hope someone can help me, thanks!
     
  2. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    If your "Events" class is a MonoBehavior/ScriptableObject then you create a CustomEditor for it
    if your "Events" class is just a normal class, then you create a PropertyDrawer for it