Esempio n. 1
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);
     }
 }
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="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. 3
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);
        }