예제 #1
0
 void Start()
 {
     _scheduler    = GameInit.CreateEventScheduler(WorldStateProvider.State);
     _currentEvent = _scheduler.PopNextEvent();
     if (_currentEvent != null)
     {
         _currentEvent.ProcessEvent(Processor);
     }
 }
예제 #2
0
        // 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();
                }
            }
        }