/// <summary> /// Creates an action group, a set which runs all actions in parallel /// </summary> /// <param name="owner">A reference to the owner of this action sequence.</param> /// <returns></returns> public static StratusActionSet Group(StratusActionsOwner owner) { // Construct the sequence StratusActionSet sequence = new StratusActionGroup(); // Add it to the owner owner.Add(sequence); // Return it return(sequence); }
/// <summary> /// Subscribes this gameobject to the action space /// </summary> /// <param name="gameObject"></param> /// <returns></returns> private StratusActionsOwner SubscribeToActions(GameObject gameObject) { if (actionsOwnerMap.ContainsKey(gameObject)) { return(actionsOwnerMap[gameObject].owner); } if (StratusActions.debug) { StratusDebug.Log("Adding the GameObject to the ActionSpace"); } var owner = new StratusActionsOwner(gameObject); ActionsContainer container = new ActionsContainer(gameObject, owner); activeActions.Add(container); actionsOwnerMap.Add(gameObject, container); gameObject.GetOrAddComponent <StratusActionsRegistration>(); return(owner); }
/// <summary> /// Cancels all active actions of the ActionsOwner. /// </summary> /// <param name="owner">A reference to the owner of this action sequence.</param> public static void Cancel(StratusActionsOwner owner) { owner.Clear(); }
public ActionsContainer(GameObject gameObject, StratusActionsOwner owner) { this.gameObject = gameObject; this.owner = owner; }