using System; using UnityEngine; namespace UnityAtoms { public abstract class GameFunction : ScriptableObject, IFunctionIcon { [HideInInspector] public Func Func; public virtual R Call() { if (Func != null) { return Func(); } throw new Exception("Either set Func or override the Call method."); } public GameFunction SetFunc(Func func) { Func = func; return this; } } public abstract class GameFunction : ScriptableObject { [HideInInspector] public Func Func; public virtual R Call(T1 t1) { if (Func != null) { return Func(t1); } throw new Exception("Either set Func or override the Call method."); } public GameFunction SetFunc(Func func) { Func = func; return this; } } public abstract class GameFunction : ScriptableObject { [HideInInspector] public Func Func; public virtual R Call(T1 t1, T2 t2) { if (Func != null) { return Func(t1, t2); } throw new Exception("Either set Func or override the Call method."); } public GameFunction SetFunc(Func func) { Func = func; return this; } } public abstract class GameFunction : ScriptableObject { [HideInInspector] public Func Func; public virtual R Call(T1 t1, T2 t2, T3 t3) { if (Func != null) { return Func(t1, t2, t3); } throw new Exception("Either set Func or override the Call method."); } public GameFunction SetFunc(Func func) { Func = func; return this; } } public abstract class GameFunction : ScriptableObject { [HideInInspector] public Func Func; public virtual R Call(T1 t1, T2 t2, T3 t3, T4 t4) { if (Func != null) { return Func(t1, t2, t3, t4); } throw new Exception("Either set Func or override the Call method."); } public GameFunction SetFunc(Func func) { Func = func; return this; } } public abstract class GameFunction : ScriptableObject { [HideInInspector] public Func Func; public virtual R Call(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { if (Func != null) { return Func(t1, t2, t3, t4, t5); } throw new Exception("Either set Func or override the Call method."); } public GameFunction SetFunc(Func func) { Func = func; return this; } } }