void Update() { Elapsed = stopwatch.ElapsedMilliseconds / 1000f; DeltaTime = (Elapsed - LastFrameTime); LastFrameTime = Elapsed; if (timeslist.Count > 0) { if (Time.time > timeslist.Keys[0]) { MyAction myAction = timeslist[timeslist.Keys[0]]; string id = myAction.guid; if (!cancelledActions.Contains(id)) { myAction.action(); } else { cancelledActions.Remove(id); } timeslist.RemoveAt(0); } } if (timeslist2.Count > 0) { if (Elapsed > timeslist2.Keys[0]) { MyAction myAction = timeslist2[timeslist2.Keys[0]]; string id = myAction.guid; if (!cancelledActions.Contains(id)) { myAction.action(); } else { cancelledActions.Remove(id); } timeslist2.RemoveAt(0); } } }