Exemple #1
0
        /// <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());
        }
Exemple #2
0
 /// <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);
 }
Exemple #3
0
		/// <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);
		}
Exemple #4
0
 /// <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;
 }
Exemple #5
0
		/// <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;
		}