예제 #1
0
        public void Start()
        {
            _questStage = QuestStage.Started;

            foreach (var script in IntroScripts)
            {
                ScriptHelpers.Execute(script);
            }

            _questStage = QuestStage.Doing;
        }
예제 #2
0
        public void Update()
        {
            if (_questStage != QuestStage.Doing)
            {
                return;
            }

            if (Tasks.Count <= 0)
            {
                _questStage = QuestStage.Completed;
            }

            for (int i = Tasks.Count - 1; i >= 0; i--)
            {
                if (Tasks[i].Evaluate())
                {
                    Tasks.RemoveAt(i);
                }
                else
                {
                    _questStage = QuestStage.Failed;
                }
            }

            if (_questStage == QuestStage.Failed)
            {
                foreach (var script in FailedScripts)
                {
                    ScriptHelpers.Execute(script);
                }
            }

            if (_questStage == QuestStage.Completed)
            {
                foreach (var script in SuccessScripts)
                {
                    ScriptHelpers.Execute(script);
                }
            }
        }
예제 #3
0
 public void Interact()
 {
     ScriptHelpers.Execute(Script, Parameter);
 }
예제 #4
0
 public void Use()
 {
     ScriptHelpers.Execute(Script, Parameter);
 }