示例#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
        private void ActivateAction()
        {
            int size = ActionsOverTimeToActivate.Count;

            for (int i = size - 1; i >= 0; i--)
            {
                ActionsOverTime.Add(ActionsOverTimeToActivate[i]);
                // Set the target.
                ActionsOverTimeToActivate[i].Target = this;
                ActionsOverTimeToActivate[i].Ready();
                // Start the action.
                ActionsOverTimeToActivate[i].Start();
            }

            ActionsOverTimeToActivate.RemoveRange(0, size);
        }
示例#3
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);
            }
        }
示例#4
0
 /// <summary>
 /// Resumes all actions.
 /// </summary>
 public void ResumeAllActions()
 {
     ActionsOverTime.ForEach((ActionOverTime item) => item.Resume());
 }
示例#5
0
 /// <summary>
 /// Pauses all actions.
 /// </summary>
 public void PauseAllActions()
 {
     ActionsOverTime.ForEach((ActionOverTime item) => item.Pause());
 }