예제 #1
0
 /// <summary>
 /// Stops all actions and clear all action lists.
 /// </summary>
 public void StopAllActions()
 {
     ActionsOverTime.ForEach((ActionOverTime item) => item.Stop());
     ActionsOverTime.Clear();
     ActionsOverTimeToActivate.Clear();
     ActionsOverTimeToRemove.Clear();
 }
예제 #2
0
        /// <summary>
        /// Update
        /// Dt is disference of time since last call
        /// </summary>
        /// <param name="dt">Dt.</param>
        public virtual void Update(GameTime dt)
        {
            if (Updatable)
            {
                foreach (ActionOverTime action in ActionsOverTime)
                {
                    action.Update(dt);
                }
                foreach (ActionOverTime action in ActionsOverTimeToRemove)
                {
                    ActionsOverTime.Remove(action);
                }
                ActionsOverTimeToRemove.Clear();

                ActivateAction();

                OnUpdate(dt);
            }
        }
예제 #3
0
 /// <summary>
 /// Called by an action when it's done.
 /// Will remove itself from the dictionary.
 /// Can be override but don't forget to call the base().
 /// </summary>
 /// <param name="action">Action.</param>
 /// <param name="args">Argument.</param>
 public virtual void ActionDone(ActionOverTime action, Object args)
 {
     action.Stop();
     ActionsOverTimeToRemove.Add(action);
 }