Hello, I have a script attached to a gameObject and I want to use Adventure Creator to remember whether the script is enabled or disabled. Could you please guide me on how to achieve this? I did come across some "Remember" scripts, but I couldn't find any that would serve this purpose.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
A GameObject's enabled state cannot be stored on the same object - because the Remember component itself must be enabled at the time of saving.
What you instead need to do is have a separate GameObject that records the state(s).
RememberMultipleEnabled.cs:
And the Editor script, RememberMultipleEnabledEditor.cs:
Sorry, I'm, trying to understand how this works:
So I saved the
RememberMultipleEnabled
in my custom script folder and theRememberMultipleEnabledEditor
in theAC\Scripts\Save System\Editor
folder.I created a gameObject in the scene named SaveControl and I attach the
RememberMultipleEnabled
script to it. Is that it?Just to clarify, I need to enable/disable the component of the gameObject, not the gameObject itself, in case I expressed myself incorrectly.
Ah. In that case, it's simpler.
You can either control the enabled state of your components with an Animator, and then use Remember Animator, or use this variant of the above that saves a component's enabled state:
and: