using System; 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; } public static GA CreateAction(Action action) where GA : GameAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GA CreateAction(Action action) where GA : GameAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GA CreateAction(Action action) where GA : GameAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GA CreateAction(Action action) where GA : GameAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GA CreateAction(Action action) where GA : GameAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GF CreateFunction(Func func) where GF : GameFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : GameFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : GameFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : GameFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : GameFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : GameFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } } }