using System; using UnityEngine; namespace UnityAtoms { /// /// Generic abstract base class for Actions. Inherits from `BaseAtom`. /// /// The type for this Action. [EditorIcon("atom-icon-purple")] public abstract class AtomAction : BaseAtom { /// /// The actual Action. /// [HideInInspector] public Action Action; /// /// Perform the Action. /// /// The first parameter. public virtual void Do(T1 t1) { if (Action != null) { Action(t1); return; } throw new Exception("Either set Action or override the Do method."); } } /// /// Generic abstract base class for Actions. Inherits from `BaseAtom`. /// /// The first type for this Action. /// The second type for this Action. [EditorIcon("atom-icon-purple")] public abstract class AtomAction : BaseAtom { /// /// The actual Action. /// [HideInInspector] public Action Action; /// /// Perform the Action. /// /// The first parameter. /// The second parameter. public virtual void Do(T1 t1, T2 t2) { if (Action != null) { Action(t1, t2); return; } throw new Exception("Either set Action or override the Do method."); } } /// /// Generic abstract base class for Actions. Inherits from `BaseAtom`. /// /// The first type for this Action. /// The second type for this Action. /// The third type for this Action. [EditorIcon("atom-icon-purple")] public abstract class AtomAction : BaseAtom { /// /// The actual Action. /// [HideInInspector] public Action Action; /// /// Perform the Action. /// /// The first parameter. /// The second parameter. /// The third parameter. public virtual void Do(T1 t1, T2 t2, T3 t3) { if (Action != null) { Action(t1, t2, t3); return; } throw new Exception("Either set Action or override the Do method."); } } /// /// Generic abstract base class for Actions. Inherits from `BaseAtom`. /// /// The first type for this Action. /// The second type for this Action. /// The third type for this Action. /// The fourth type for this Action. [EditorIcon("atom-icon-purple")] public abstract class AtomAction : BaseAtom { /// /// The actual Action. /// [HideInInspector] public Action Action; /// /// Perform the Action. /// /// The first parameter. /// The second parameter. /// The third parameter. /// The fourth parameter. public virtual void Do(T1 t1, T2 t2, T3 t3, T4 t4) { if (Action != null) { Action(t1, t2, t3, t4); return; } throw new Exception("Either set Action or override the Do method."); } } /// /// Generic abstract base class for Actions. Inherits from `BaseAtom`. /// /// The first type for this Action. /// The second type for this Action. /// The third type for this Action. /// The fourth type for this Action. /// The fifth type for this Action. [EditorIcon("atom-icon-purple")] public abstract class AtomAction : BaseAtom { /// /// The actual Action. /// [HideInInspector] public Action Action; /// /// Perform the Action. /// /// The first parameter. /// The second parameter. /// The third parameter. /// The fourth parameter. /// The fifth parameter. public virtual void Do(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5) { if (Action != null) { Action(t1, t2, t3, t4, t5); return; } throw new Exception("Either set Action or override the Do method."); } } }