Hi,
I just purchased Easy Save and I'm trying to use it serialize UnityEvents in one of my scripts. The Unity Events are wired up to call a method in a child gameObject.
Whats the proper way to ensure this gets repopulated correctly?
The below class below is an example of what I'm trying to save an array of....and I need to make sure the persistent calls for onActive and onInactive are correctly populated.
[System.Serializable]
public class ItemUpgrade {
public string title;
public string name;
public string description;
public int filament;
public bool isActive;
public bool purchased;
[Header("Events")]
public UnityEvent onActive;
public UnityEvent onInactive;
}
Should I just be saving the gameObject? (Its a complicated gameObject and I was trying to only save what I need.)
Please let me know whats the proper way to save them...thanks.
Issue with Saving/Loading Unity Events
Issue with Saving/Loading Unity Events
- Attachments
-
- EasySave3.png (262.47 KiB) Viewed 667 times
Re: Issue with Saving/Loading Unity Events
Hi there,
Unity provides no way of serialising UnityEvents at runtime.
If you show me the code you're using to change your UnityEvent at runtime I may be able to provide a workaround, though this depends on what changes you're making.
All the best,
Joel
Unity provides no way of serialising UnityEvents at runtime.
If you show me the code you're using to change your UnityEvent at runtime I may be able to provide a workaround, though this depends on what changes you're making.
All the best,
Joel