Esempio n. 1
0
    //FUNCTION : AssignedQuest
    //DESCRIPTION : Assigns the quest to the player if needed
    void AssignQuest()
    {
        //checking to see if valid

        for (int i = 0; i < QuestList.Count; i++)
        {
            if (!QM.searchCQNList(QuestList[i].QuestName))
            {
                if (QM.searchCQNList(QuestList[i].Prereq1) && QM.searchCQNList(QuestList[i].Prereq2))
                {
                    Quest = QuestList[i];

                    AssignedQuest = true;
                    Quest.Load();
                    Quest.StartText();
                    Quest.isActive = true;
                    QM.AddActiveQuests(Quest);
                    if (questIndicator)
                    {
                        questIndicator.GetComponent <ToggleColor>().SetIconMaterialTaken();
                    }
                    QM.CheckItems();
                    return;
                }
            }
        }
        NoMoreQuest();
    }