Example #1
0
        void Awake()
        {
            // Populate defenition dictionary with error checking
            foreach (QuestEntry quest in defenitions.Quests)
            {
                Debug.Assert(string.IsNullOrEmpty(quest.id), string.Format("QuestEntry {0} is missing an ID", quest.displayName));
                Debug.Assert(questLib.ContainsKey(quest.id), string.Format("Duplicate QuestEntry ID on {0}", quest.displayName));
                questLib[quest.id] = new QuestEntryDetails {
                    defenition = quest
                };

                foreach (QuestTask task in quest.Tasks)
                {
                    Debug.Assert(string.IsNullOrEmpty(task.id), string.Format("QuestTask {0} is missing an ID", task.displayName));
                    Debug.Assert(questTaskLib.ContainsKey(task.id), string.Format("Duplicate QuestTask ID on {0}", task.displayName));
                    questTaskLib[task.id] = new QuestTaskDetails {
                        defenition = task
                    };
                }
            }

            status = new QuestConditions {
                ctrl = this
            };
        }
        void Awake()
        {
            // Populate defenition dictionary with error checking
            foreach (QuestEntry quest in defenitions.Quests) {
                Debug.Assert(string.IsNullOrEmpty(quest.id), string.Format("QuestEntry {0} is missing an ID", quest.displayName));
                Debug.Assert(questLib.ContainsKey(quest.id), string.Format("Duplicate QuestEntry ID on {0}", quest.displayName));
                questLib[quest.id] = new QuestEntryDetails {
                    defenition = quest
                };

                foreach (QuestTask task in quest.Tasks) {
                    Debug.Assert(string.IsNullOrEmpty(task.id), string.Format("QuestTask {0} is missing an ID", task.displayName));
                    Debug.Assert(questTaskLib.ContainsKey(task.id), string.Format("Duplicate QuestTask ID on {0}", task.displayName));
                    questTaskLib[task.id] = new QuestTaskDetails {
                        defenition = task
                    };
                }
            }

            status = new QuestConditions {
                ctrl = this
            };
        }