Create() публичный статический Метод

Creates a new Timer.
public static Create ( float tickLength, bool repeats, Action tick ) : Timer
tickLength float The amount of time between the timer's ticks.
repeats bool Whether or not the timer repeats.
tick Action An action to perform when the timer ticks.
Результат Timer
Пример #1
0
 /// <summary>
 ///   Occurs once the GameState is loaded; Unregisters from the LoadingCompleted event and waits 1 sec before switching to GameState rendering
 /// </summary>
 /// <param name = "sender"></param>
 /// <param name = "e"></param>
 protected virtual void OnGameStateLoadingCompleted(object sender, EventArgs e)
 {
     _gameStateLoading.LoadingCompleted -= OnGameStateLoadingCompleted;
     Timer.Create(1, false, tick =>
     {
         ShouldRenderLoadedGameState = true;
         Application.SuppressDraw();
     });
 }
Пример #2
0
 /// <summary>
 ///   Fades the whole Application screen out.
 /// </summary>
 /// <param name = "endColor">The Color used for end</param>
 /// <param name = "length">The length in seconds the fade operation should last</param>
 /// <param name="waitingTime">The seconds to wait before starting the fade</param>
 public static void FadeOut(Color endColor, float length, float waitingTime)
 {
     Timer.Create(waitingTime, false, tick => FadeOut(endColor, length));
 }
Пример #3
0
 /// <summary>
 ///   Fades the whole Application screen in.
 /// </summary>
 /// <param name = "startColor">The Color used for start</param>
 /// <param name = "length">The length in seconds the fade operation should last</param>
 /// <param name="waitingTime">The seconds to wait before starting the fade</param>
 public static void FadeIn(Color startColor, float length, float waitingTime)
 {
     Timer.Create(waitingTime, false, tick => FadeIn(startColor, length));
 }