using UnityEngine; namespace UnityAtoms.Utils { public static class DynamicAtoms { public static V CreateVariable(bool createChangedEvent = true, bool createChangedWithHistoryEvent = false) where V : ScriptableObjectVariable where E1 : GameEvent where E2 : GameEvent { var sov = ScriptableObject.CreateInstance(); sov.Changed = createChangedEvent ? ScriptableObject.CreateInstance() : null; sov.ChangedWithHistory = createChangedWithHistoryEvent ? ScriptableObject.CreateInstance() : null; return sov; } public static L CreateList(bool createAddedEvent = false, bool createRemovedEvent = false, bool createClearedEvent = false) where L : ScriptableObjectList where E : GameEvent { var sol = ScriptableObject.CreateInstance(); sol.Added = createAddedEvent ? ScriptableObject.CreateInstance() : null; sol.Removed = createRemovedEvent ? ScriptableObject.CreateInstance() : null; sol.Cleared = createClearedEvent ? ScriptableObject.CreateInstance() : null; return sol; } } }