Timer System in GameManager with two lists
 Basically I have these timers in my game that work perfectly, but they are instances in a scene. I figured that I will need some of them to work for minutes, and the player will be able to leave the scene and come back later, so I thought I would make the GameManager (which persist through scenes) to handle all timers. The problem now is I need to send the Object and TimeLeftToCompletion of the Instantiated timer to the GM, I did it with two lists, but I don't know how to say "When I add this Object relate it to its TimeLeftToCompletion."
EDIT: I have made a lot of progress (I think) but still not got it to work properly:
     static List<CircularTimer> timers = new List<CircularTimer>();
     static List<float> sentTime = new List<float>();
     int index;
 
     private void Update()
     {
         index = 0;
         foreach (CircularTimer timer in timers)
         {
             foreach(float time in sentTime)
             {
                 sentTime[index] -= Time.deltaTime;
                 if (sentTime[index] <= 0)
                 {
                     //???????????????
                     //sentTime.Remove(????????);
                     Debug.Log("TIMER IS 0!");
                     //HERE somehow make the current timer do its OnTimeFinished action
                 }
                 index++;
             }            
         }
     }
 public static void StartTimer(CircularTimer timer, float time)
 {
     timers.Add(timer);
     sentTime.Add(time);
 }
 
               TL:DR: How do I link the Object in list1 position 1 to the float in list2 position 1 and so on? If I manage to get this done I would have a pretty neat timer system that could work through scenes, should I upload it to the asset store for free or is it not very optimized to share it?
Im reworking all of this into coroutines in a new script that goes in the $$anonymous$$anager object, I use this same lists and the index but all inside a coroutine, I'll update if it works.
Your answer
 
             Follow this Question
Related Questions
How do I create a timer. 1 Answer
Start and Stop Timer Help 1 Answer
How can change the text in UI text component each 5 seconds after start timer 1 Answer
I need a "loop" timer that disables a action until the timer resets. 0 Answers
How to make a timer and health bar transition between scenes using a game manager? 0 Answers