/// <summary> /// Returns short information about the timer /// </summary> /// <returns>Short info about the timer</returns> public override string ToString() { RegionTimerCallback callback = m_callback; object target = null; if (callback != null) { target = callback.Target; } return(new StringBuilder(128) .Append("callback: ").Append(callback == null ? "(null)" : callback.Method.Name) .Append(' ').Append(base.ToString()) .Append(" target: ").Append(target == null ? "" : (target.GetType().FullName + " ")) .Append('(').Append(target == null ? "null" : target.ToString()) .Append(')') .ToString()); }
/// <summary> /// Constructs a new region timer and starts it with specified delay /// </summary> /// <param name="timerOwner">The game object that is starting the timer</param> /// <param name="callback">The callback function to call</param> /// <param name="delay">The interval in milliseconds when to call the callback (>0)</param> public RegionTimer(GameObject timerOwner, RegionTimerCallback callback, int delay) : this(timerOwner, callback) { m_owner = timerOwner; Start(delay); }
/// <summary> /// Constructs a new region timer /// </summary> /// <param name="timerOwner">The game object that is starting the timer</param> /// <param name="callback">The callback function to call</param> public RegionTimer(GameObject timerOwner, RegionTimerCallback callback) : this(timerOwner) { m_owner = timerOwner; m_callback = callback; }