Forum rules - please read before posting.

Subclassing from Remember removes existing inspector variables

I'm sure I'm just doing something wrong but I can't seem to figure out what it is. I had an existing script subclassed from MonoBehaviour  with a few variables I was keeping track of on some objects in a scene. I wanted to save these values when I save the game so I changed the script to subclass from AC.Remember and added the SaveData and LoadData overrides and added a new class with the RememberData subclass to store this data, etc. When I go back into the inspector now though my script only has the 'Constant ID number' settings and my variable settings are gone.

Looking at, for example, RememberHotspot or RememberTransform it seems like it should be possible to add my values and still have the Constant ID portion in the inspector but I can't see how they do this. Any pointers? I have tried adding something like:
[AddComponentMenu("My Class Name With Spaces")]
above my class definition but it doesn't work.

Thanks.

Comments

  • Ok, well I feel dumb. There are custom editors defined for all of those scripts but for some reason I was having trouble finding them in Visual C# and hence my confusion. Adding a custom editor for my new script fixed it quickly.

    My apologies.
  • That brings up a good point!  I'll have to look into adding a note about that in the tutorial, thanks for bringing it up.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.