Search Unity

Editing a struct of an unknown type in the inspector

Discussion in 'Scripting' started by Wolfos, Apr 26, 2018.

  1. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    951
    So here's the problem I have; I want to pass a bunch of data from one scene to another in a generic manner. So in scene 1 you could have a script with a dropdown box to choose the type of data you want to configure, then the inspector would show the values of that struct. Then scene 2 would be able to read that data.

    My issue is mostly with getting the inspector to display this. Is it possible to do this with a custom inspector, without having to manually create an inspector for each struct?
     
  2. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838