Example #1
0
        /// <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(StratusActionDriver 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 StratusActionDriver SubscribeToActions(GameObject gameObject)
        {
            if (this.actionsOwnerMap.ContainsKey(gameObject))
            {
                return(this.actionsOwnerMap[gameObject].owner);
            }

            if (StratusActions.debug)
            {
                StratusDebug.Log("Adding the GameObject to the ActionSpace");
            }

            StratusActionDriver owner     = new StratusActionDriver(gameObject);
            ActionsContainer    container = new ActionsContainer(gameObject, owner);

            this.activeActions.Add(container);
            this.actionsOwnerMap.Add(gameObject, container);
            gameObject.GetOrAddComponent <StratusActionsRegistration>();
            return(owner);
        }
 public ActionsContainer(GameObject gameObject, StratusActionDriver owner)
 {
     this.gameObject = gameObject;
     this.owner      = owner;
 }
Example #4
0
 /// <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(StratusActionDriver owner)
 {
     owner.Clear();
 }