/// <summary> /// Sets a timer to call the given native function at a set interval. If a timer is already set /// for this delegate, it will update the current timer to the new parameters and reset its /// elapsed time to 0. /// </summary> /// <param name="obj">Object to call the timer function on.</param> /// <param name="functionName">Method to call when timer fires (must be a UFunction method).</param> /// <param name="time">The amount of time between set and firing. If <= 0.f, clears existing timers.</param> /// <param name="looping">true to keep firing at Rate intervals, false to fire only once.</param> /// <param name="firstDelay">The time for the first iteration of a looping timer. If < 0.f inRate will be used.</param> /// /// <returns>The handle for the timer.</returns> public FTimerHandle SetTimer(UObject obj, FName functionName, float time, bool looping, float firstDelay) { FTimerHandle handle = default(FTimerHandle); SetTimer(ref handle, obj, functionName, time, looping, firstDelay); return(handle); }
/// <summary> /// Sets a timer to call the given native function at a set interval. If a timer is already set /// for this delegate, it will update the current timer to the new parameters and reset its /// elapsed time to 0. /// </summary> /// <param name="obj">Object to call the timer function on.</param> /// <param name="function">Method to call when timer fires (must be a UFunction method).</param> /// <param name="time">The amount of time between set and firing. If <= 0.f, clears existing timers.</param> /// <param name="looping">true to keep firing at Rate intervals, false to fire only once.</param> /// <param name="firstDelay">The time for the first iteration of a looping timer. If < 0.f inRate will be used.</param> /// <returns>The handle for the timer.</returns> public FTimerHandle SetTimer(UObject obj, FSimpleDelegate function, float time, bool looping = false, float firstDelay = -1.0f) { FTimerHandle handle = default(FTimerHandle); SetTimer(ref handle, obj, GetFunctionName(obj, function), time, looping, firstDelay); return(handle); }
/// <summary> /// Sets a timer to call the given native function at a set interval. If a timer is already set /// for this delegate, it will update the current timer to the new parameters and reset its /// elapsed time to 0. /// </summary> /// <param name="obj">Object to call the timer function on.</param> /// <param name="functionName">Method to call when timer fires (must be a UFunction method).</param> /// <param name="time">The amount of time between set and firing. If <= 0.f, clears existing timers.</param> /// <param name="looping">true to keep firing at Rate intervals, false to fire only once.</param> /// <param name="firstDelay">The time for the first iteration of a looping timer. If < 0.f inRate will be used.</param> /// <returns>The handle for the timer.</returns> public FTimerHandle SetTimer(UObject obj, string functionName, float time, bool looping = false, float firstDelay = -1.0f) { FTimerHandle handle = default(FTimerHandle); SetTimer(ref handle, obj, new FName(functionName), time, looping, firstDelay); return(handle); }
/// <summary> /// Sets a timer to call the given native function at a set interval. If a timer is already set /// for this delegate, it will update the current timer to the new parameters and reset its /// elapsed time to 0. /// </summary> /// <param name="inOutHandle">Handle to identify this timer. If it is invalid when passed in it will be made into a valid handle.</param> /// <param name="obj">Object to call the timer function on.</param> /// <param name="functionName">Method to call when timer fires (must be a UFunction method).</param> /// <param name="time">The amount of time between set and firing. If <= 0.f, clears existing timers.</param> /// <param name="looping">true to keep firing at Rate intervals, false to fire only once.</param> /// <param name="firstDelay">The time for the first iteration of a looping timer. If < 0.f inRate will be used.</param> public void SetTimer(ref FTimerHandle inOutHandle, UObject obj, FName functionName, float time, bool looping, float firstDelay) { if (ValidateFunction(obj, functionName)) { FScriptDelegate del = new FScriptDelegate(obj, functionName); Native_FTimerManager.SetTimer(Address, ref inOutHandle, ref del, time, looping, firstDelay); } }
public FTimerHandle FindTimerHandle(UObject obj, FName functionName) { FTimerHandle result = default(FTimerHandle); if (obj != null && functionName != FName.None) { FScriptDelegate del = new FScriptDelegate(obj, functionName); Native_FTimerManager.K2_FindDynamicTimerHandle(Address, ref del, ref result); } return(result); }
/// <summary> /// Gets the time remaining before the specified timer is called /// </summary> /// <param name="handle">The handle of the timer to check the remaining time of.</param> /// <returns>The current time remaining, or -1.f if timer does not exist</returns> public float GetTimerRemaining(FTimerHandle handle) { return(Native_FTimerManager.GetTimerRemaining(Address, ref handle)); }
/// <summary> /// Gets the current elapsed time for the specified timer. /// </summary> /// <param name="handle">The handle of the timer to check the elapsed time of.</param> /// <returns>The current time elapsed or -1.f if the timer does not exist.</returns> public float GetTimerElapsed(FTimerHandle handle) { return(Native_FTimerManager.GetTimerElapsed(Address, ref handle)); }
/// <summary> /// Returns true if the specified timer exists /// </summary> /// <param name="handle">The handle of the timer to check for existence.</param> /// <returns>true if the timer exists, false otherwise.</returns> public bool TimerExists(FTimerHandle handle) { return(Native_FTimerManager.TimerExists(Address, ref handle)); }
/// <summary> /// Returns true if the specified timer exists and is pending /// </summary> /// <param name="handle">The handle of the timer to check for being pending.</param> /// <returns>true if the timer exists and is pending, false otherwise.</returns> public bool IsTimerPending(FTimerHandle handle) { return(Native_FTimerManager.IsTimerPending(Address, ref handle)); }
/// <summary> /// Unpauses a previously set timer. /// </summary> /// <param name="handle">The handle of the timer to unpause.</param> public void UnPauseTimer(FTimerHandle handle) { Native_FTimerManager.UnPauseTimer(Address, ref handle); }
/// <summary> /// Clears a previously set timer, identical to calling SetTimer() with a <= 0.f rate. /// Invalidates the timer handle as it should no longer be used. /// </summary> /// <param name="handle">The handle of the timer to clear.</param> public void ClearTimer(ref FTimerHandle handle) { Native_FTimerManager.ClearTimer(Address, ref handle); }
/// <summary> /// Sets a timer to call the given native function at a set interval. If a timer is already set /// for this delegate, it will update the current timer to the new parameters and reset its /// elapsed time to 0. /// </summary> /// <param name="inOutHandle">Handle to identify this timer. If it is invalid when passed in it will be made into a valid handle.</param> /// <param name="obj">Object to call the timer function on.</param> /// <param name="function">Method to call when timer fires (must be a UFunction method).</param> /// <param name="time">The amount of time between set and firing. If <= 0.f, clears existing timers.</param> /// <param name="looping">true to keep firing at Rate intervals, false to fire only once.</param> /// <param name="firstDelay">The time for the first iteration of a looping timer. If < 0.f inRate will be used.</param> public void SetTimer(ref FTimerHandle inOutHandle, UObject obj, FSimpleDelegate function, float time, bool looping = false, float firstDelay = -1.0f) { SetTimer(ref inOutHandle, obj, GetFunctionName(obj, function), time, looping, firstDelay); }
/// <summary> /// Sets a timer to call the given native function at a set interval. If a timer is already set /// for this delegate, it will update the current timer to the new parameters and reset its /// elapsed time to 0. /// </summary> /// <param name="inOutHandle">Handle to identify this timer. If it is invalid when passed in it will be made into a valid handle.</param> /// <param name="obj">Object to call the timer function on.</param> /// <param name="functionName">Method to call when timer fires (must be a UFunction method).</param> /// <param name="time">The amount of time between set and firing. If <= 0.f, clears existing timers.</param> /// <param name="looping">true to keep firing at Rate intervals, false to fire only once.</param> /// <param name="firstDelay">The time for the first iteration of a looping timer. If < 0.f inRate will be used.</param> public void SetTimer(ref FTimerHandle inOutHandle, UObject obj, string functionName, float time, bool looping = false, float firstDelay = -1.0f) { SetTimer(ref inOutHandle, obj, new FName(functionName), time, looping, firstDelay); }
/// <summary> /// Get the current last assigned handle /// </summary> public static void ValidateHandle(ref FTimerHandle inOutHandle) { Native_FTimerManager.ValidateHandle(ref inOutHandle); }