private void Awake() { DontDestroyOnLoad(this.gameObject); handler = GameObject.Find("Quest Handler").GetComponent <QQ_QuestHandler>(); // Assign the quest "Bob Wants Tomatoes" handler.AssignQuest("Bob Wants Tomatoes"); // handler.AssignQuest("Testing"); // Set the quest as active/currently being tracked handler.ActivateQuest("Bob Wants Tomatoes"); //handler.ActivateQuest("Testing"); //handler.DeactivateQuest("Testing"); // Get the quest from the handler quest = handler.GetQuest("Bob Wants Tomatoes"); //quest2 = handler.GetQuest("Testing"); // Set the quest name text to the name of the current quest questName.text = quest.Name; // Set the main task name text to the name of the first task mainTaskName.text = quest.Tasks[0].Name; // Get the main task using its name QQ_Task mainTask = handler.GetTask("Bob Wants Tomatoes", "Get Tomatoes for Bob"); // Set the smaller task 1 name text to the name of the first task int taskID = mainTask.NextTasks[0]; // Get the ID of the next task smallerTask1Name.text = quest.GetTask(taskID).Name; // Display the name // Set the smaller task 2 name text to the name of the first task taskID = mainTask.NextTasks[1]; // Get the ID of the next task smallerTask2Name.text = handler.GetTask("Bob Wants Tomatoes", taskID).Name; // Display the name }
public void TurnInQuest() { if (inventory.GetStock("Flower") >= handler.GetTask(questName, "Pick flower").MaxProgress) { handler.ProgressTask(questName, "Pick flower", handler.GetTask(questName, "Pick flower").MaxProgress); inventory.RemoveItem("Flower", (int)handler.GetTask(questName, "Pick flower").MaxProgress); } }