using UnityEngine; namespace UnityAtoms.Utils { public static class DynamicAtoms { public static V CreateVariable(T initialValue, E1 changed = null, E2 changedWithHistory = null) where V : ScriptableObjectVariable where E1 : GameEvent where E2 : GameEvent { var sov = ScriptableObject.CreateInstance(); sov.Changed = changed; sov.ChangedWithHistory = changedWithHistory; sov.Value = initialValue; return sov; } public static L CreateList(E added = null, E removed = null, VoidEvent cleared = null) where L : ScriptableObjectList where E : GameEvent { var sol = ScriptableObject.CreateInstance(); sol.Added = added; sol.Removed = removed; sol.Cleared = cleared; return sol; } } }