using System; using UnityEngine; namespace UnityAtoms { /// /// Base abstract class for Actions. Inherits from `BaseAtom`. /// public abstract class AtomAction : BaseAtom { /// /// The actual Action. /// [HideInInspector] public Action ActionNoValue; /// /// Perform the Action. /// public virtual void Do() { if (ActionNoValue != null) { ActionNoValue(); return; } } } /// /// Generic abstract base class for Actions. Inherits from `AtomAction`. /// /// The type for this Action. public abstract class AtomAction : AtomAction { /// /// The actual Action. /// [HideInInspector] public Action Action; /// /// Perform the Action. /// /// The first parameter. public virtual void Do(T1 t1) { base.Do(); 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 `AtomAction`. /// /// The first type for this Action. /// The second type for this Action. public abstract class AtomAction : AtomAction { /// /// The actual Action. /// [HideInInspector] public Action Action; /// /// Perform the Action. /// /// The first parameter. /// The second parameter. public virtual void Do(T1 t1, T2 t2) { base.Do(); 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 `AtomAction`. /// /// The first type for this Action. /// The second type for this Action. /// The third type for this Action. public abstract class AtomAction : AtomAction { /// /// 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) { base.Do(); 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 `AtomAction`. /// /// The first type for this Action. /// The second type for this Action. /// The third type for this Action. /// The fourth type for this Action. public abstract class AtomAction : AtomAction { /// /// 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) { base.Do(); 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 `AtomAction`. /// /// 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. public abstract class AtomAction : AtomAction { /// /// 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) { base.Do(); if (Action != null) { Action(t1, t2, t3, t4, t5); return; } throw new Exception("Either set Action or override the Do method."); } } }