- Home /
Customize how class attributes are shown in the Inspector?
I am trying to create a script for a button in my main menu, which sends you to the Network Lobby Scene (since it's a multiplayer game) where you can join or host your own game. I wanted to add an attribute which contains the scene to which that button sends you, just like the Online Scene / Offline Scene fields of the NetworkManager. However, if I set Scene as my attribute's type, it does not appear in the inspector. I found out that the NetworkManager's fields are strings, but I couldn't find any hint why in the inspector they are shown as Scene Assets.
So my question is, how does that work? How can you customize how the inspector shows your variables and in what way the values you add are then inserted into your variables in the script? (Since in this case only the Scene Asset's name has to be storaged.)