Exemple #1
0
    public static void Add(Action action, float TimeInterval)
    {
        if (Instance.periodicUpdateActions.Any(x => x.Action == action))
        {
            return;
        }
        TimedUpdate timedUpdate = Instance.GetTimedUpdates();

        timedUpdate.SetUp(action, TimeInterval);
        Instance.periodicUpdateActions.Add(timedUpdate);
    }
Exemple #2
0
    public static void Add(Action action, float timeInterval)
    {
        if (Instance.periodicUpdateActions.Any(x => x.Action == action))
        {
            return;
        }
        TimedUpdate timedUpdate = Instance.GetTimedUpdates();

        timedUpdate.SetUp(action, timeInterval);
        timedUpdate.TimeTitleNext += NumberOfUpdatesAdded * 0.1f;
        NumberOfUpdatesAdded++;
        Instance.periodicUpdateActions.Add(timedUpdate);
    }
    public static void Add(Action action, float timeInterval)
    {
        if (Instance.periodicUpdateActions.Any(x => x.Action == action))
        {
            return;
        }
        TimedUpdate timedUpdate = Instance.GetTimedUpdates();

        timedUpdate.SetUp(action, timeInterval);
        timedUpdate.TimeTitleNext += NumberOfUpdatesAdded * 0.01f;
        NumberOfUpdatesAdded++;
        if (NumberOfUpdatesAdded > 500)
        {
            NumberOfUpdatesAdded = 0;             //So the delay can't be too big
        }

        Instance.periodicUpdateActions.Add(timedUpdate);
    }