Esempio n. 1
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="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>
        /// /// <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);
        }
Esempio n. 2
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="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 &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>
        /// <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);
        }
Esempio n. 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="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>
        /// <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);
        }
Esempio n. 4
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);
     }
 }
Esempio n. 5
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);
        }
Esempio n. 6
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));
 }
Esempio n. 7
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));
 }
Esempio n. 8
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));
 }
Esempio n. 9
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));
 }
Esempio n. 10
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);
 }
Esempio n. 11
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);
 }
Esempio n. 12
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="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 &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, FSimpleDelegate function, float time, bool looping = false, float firstDelay = -1.0f)
 {
     SetTimer(ref inOutHandle, obj, GetFunctionName(obj, function), time, looping, firstDelay);
 }
Esempio n. 13
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, string functionName, float time, bool looping = false, float firstDelay = -1.0f)
 {
     SetTimer(ref inOutHandle, obj, new FName(functionName), time, looping, firstDelay);
 }
Esempio n. 14
0
 /// <summary>
 /// Get the current last assigned handle
 /// </summary>
 public static void ValidateHandle(ref FTimerHandle inOutHandle)
 {
     Native_FTimerManager.ValidateHandle(ref inOutHandle);
 }