/// <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(); }
/// <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); } }
/// <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); }