Ejemplo n.º 1
0
    /// <summary>
    /// Registers the cooling time.
    /// </summary>
    /// <param name="timerKey">Timer key.</param>
    /// <param name="delayTime">Delay time.</param>
    /// <param name="callback">Callback.</param>
    public static void RegisterCoolingTime(string timerKey, float delayTime, Action <string> callback)
    {
        if (!CoolingList.ContainsKey(timerKey))
        {
            TimerItem timerItem = null;
            if (!CoolingList.ContainsKey(timerKey))
            {
                GameObject objectItem = new GameObject();
                objectItem.name = timerKey;

                timerItem = objectItem.AddComponent <TimerItem>();
                timerItem.Init(timerKey, TimerManager.time, delayTime, callback);
                CoolingList.Add(timerKey, timerItem);
            }
            else
            {
                timerItem = CoolingList[timerKey];
            }
        }
    }