Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        /// <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);
        }
Ejemplo n.º 3
0
 public ActionsContainer(GameObject gameObject, StratusActionDriver owner)
 {
     this.gameObject = gameObject;
     this.owner      = owner;
 }
Ejemplo n.º 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();
 }