/// <summary> /// /// </summary> /// <param name="gameTime"></param> /// <returns></returns> public override bool Act(GameTime gameTime) { if (hasCompleted) { // Nothing left to do return(true); } if (!hasBegan) { OnBegin(); hasBegan = true; } TimeElapsed += (float)gameTime.ElapsedGameTime.TotalMilliseconds; hasCompleted = (TimeElapsed >= Duration); float percent; if (hasCompleted) { percent = 1; } else { percent = TimeElapsed / Duration; if (Ease != null) { percent = Ease.Apply(percent); } } Update(Reverse ? 1 - percent : percent); if (hasCompleted) { OnCompleted(); } return(hasCompleted); }