void Start() { _scheduler = GameInit.CreateEventScheduler(WorldStateProvider.State); _currentEvent = _scheduler.PopNextEvent(); if (_currentEvent != null) { _currentEvent.ProcessEvent(Processor); } }
// Update is called once per frame void Update() { if (buttonApply) { buttonApply = false; for (int i = 0; i < skipEventsCount; i++) { _scheduler.PopNextEvent(); } var info = Attribs.GetAttribByName("Info"); var panic = Attribs.GetAttribByName("Panic"); var fun = Attribs.GetAttribByName("Fun"); var tom = Attribs.GetAttribByName("Tom"); var alice = Attribs.GetAttribByName("Alice"); var s = WorldStateProvider.State; s.AddToValue(alice, addToAttributeAlice); s.AddToValue(panic, addToAttributePanic); s.AddToValue(tom, addToAttributeTom); s.AddToValue(fun, addToAttributeFun); s.AddToValue(info, addToAttributeInfo); } if (_currentEvent == null) { return; } if (_currentEvent.IsFinished) { _currentEvent = _scheduler.PopNextEvent(); if (_currentEvent != null) { _currentEvent.ProcessEvent(Processor); } else { GetComponent <ScenePicker>().LoadScene(); } } }