예제 #1
0
    private Quest GenerateFetch(QuestName questName, String nameString, int nbItems, QuestItemName questItemName, Scenes region, Vector3 goalLocation,
                                params GameObject[] requisitePrefabs)
    {
        Quest     quest  = GenerateQuest(questName, nameString, QuestType.FETCH, requisitePrefabs.ToList(), region, goalLocation);
        QuestItem potion = new QuestItem();

        potion.GenerateQuestItem(questItemName);
        quest.m_ItemInformation         = potion;
        quest.m_Fetch.m_PlayerInventory = this.m_Player.GetComponent <PlayerInventory>();
        quest.m_NumberOfItemsToFind     = nbItems;

        return(quest);
    }
예제 #2
0
    }     //end f'n void ParseQuestItemList(GameObject)

    /**A function to set the player inventory quest item list based on saved content.
     * Clears player quest item list before adding anything.*/
    public void SetQuestItemList(GameObject player)
    {
        PlayerInventory player_inventory = player.GetComponent <PlayerInventory> ();

        player_inventory.m_QuestItems.Clear();

        for (int index = 0; index < this.m_QuestItemNames.Count; index++)
        {
            QuestItem item_to_add = new QuestItem();
            foreach (QuestItemName name in System.Enum.GetValues(typeof(QuestItemName)))
            {
                if (this.m_QuestItemNames [index] == name.ToString())
                {
                    item_to_add.GenerateQuestItem(name);
                    player_inventory.m_QuestItems.Add(item_to_add);
                } //end if
            }     //end foreach
        }         //end for
    }             //end f'n void SetQuestItemList(GameObject)