public void StartStory()
        {
            _storyGraph.ConnectStoryElements();
            _currentElement = _storyGraph.GetRootStory()[0];

            _currentTask           = TaskManager.CreateTask(_currentElement.Execute(_manager, _canvas));
            _currentTask.Finished += AdvanceStory;

            _currentTask.Start();
        }
        public void AdvanceStory(bool manual)
        {
            if (!manual && !_handlingSubgraph)
            {
                if (_currentElement.Next != null && _currentTask != null && !_currentTask.Running)
                {
                    _currentElement = _currentElement.Next;

                    _currentTask           = TaskManager.CreateTask(_currentElement.Execute(_manager, _canvas));
                    _currentTask.Finished += AdvanceStory;
                    _currentTask.Start();
                }
                else
                {
                    _afterSubgraphHandler?.Invoke();
                }
            }
        }
        public void AdvanceStory(StoryElement newStoryPoint, bool continueToRun = false)
        {
            if (_handlingSubgraph)
            {
                _subgraphHandler.AdvanceStory(false);
            }
            else if (newStoryPoint != null)
            {
                if (!continueToRun)
                {
                    _currentTask.Stop();
                }

                _currentElement = newStoryPoint;

                _currentTask           = TaskManager.CreateTask(_currentElement.Execute(_manager, _canvas));
                _currentTask.Finished += AdvanceStory;
                _currentTask.Start();
            }
            else
            {
                _afterSubgraphHandler?.Invoke();
            }
        }
예제 #4
0
 public void Start()
 {
     task.Start();
 }