Beispiel #1
0
 // TODO: Change the parameter to use a concrete type UGameInstance
 /// <summary>
 /// Used by the UGameInstance constructor to set this manager's owning game instance.
 /// </summary>
 public void SetGameInstance(UObject gameInstance)
 {
     if (gameInstance != null && gameInstance.GetClass().Address == Classes.UGameInstance)
     {
         Native_FTimerManager.SetGameInstance(Address, gameInstance.Address);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Sets a timer to call the given native function on the next tick
 /// (this could be called RunFunctionOnNextTick as it isn't really timer related (aside from being done by FTimerManager)).
 /// </summary>
 /// <param name="obj">Object to call the timer function on.</param>
 /// <param name="functionName">Method to call when timer fires.</param>
 public void SetTimerForNextTick(UObject obj, FName functionName)
 {
     if (ValidateFunction(obj, functionName))
     {
         FScriptDelegate del = new FScriptDelegate(obj, functionName);
         Native_FTimerManager.SetTimerForNextTick(Address, ref del);
     }
 }
Beispiel #3
0
 /// <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 &lt;= 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 &lt; 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);
     }
 }
Beispiel #4
0
        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);
        }
Beispiel #5
0
 /// <summary>
 /// Debug command to output info on all timers currently set to the log.
 /// </summary>
 public void ListTimers()
 {
     Native_FTimerManager.ListTimers(Address);
 }
Beispiel #6
0
 public bool HasBeenTickedThisFrame()
 {
     return(Native_FTimerManager.HasBeenTickedThisFrame(Address));
 }
Beispiel #7
0
 /// <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));
 }
Beispiel #8
0
 /// <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));
 }
Beispiel #9
0
 /// <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));
 }
Beispiel #10
0
 /// <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));
 }
Beispiel #11
0
 /// <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);
 }
Beispiel #12
0
 /// <summary>
 /// Clears all timers that are bound to functions on the given object.
 /// </summary>
 public void ClearAllTimersForObject(UObject obj)
 {
     Native_FTimerManager.ClearAllTimersForObject(Address, obj.Address);
 }
Beispiel #13
0
 /// <summary>
 /// Clears a previously set timer, identical to calling SetTimer() with a &lt;= 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);
 }
Beispiel #14
0
 public void Tick(float deltaTime)
 {
     Native_FTimerManager.Tick(Address, deltaTime);
 }
Beispiel #15
0
 /// <summary>
 /// Get the current last assigned handle
 /// </summary>
 public static void ValidateHandle(ref FTimerHandle inOutHandle)
 {
     Native_FTimerManager.ValidateHandle(ref inOutHandle);
 }