예제 #1
0
 bool SearchInventory(string itemName, int reqAmt)
 {
     if (inventory.SearchInventory(itemName) == reqAmt)
     {
         return(true);
     }
     else
     {
         Debug.Log("Playing nothing happened scene");
         PlayNothingHappenedScene();
         return(false);
     }
 }
예제 #2
0
    void CheckIfPlayerHasQuestItems()
    {
        //Example. We have 2 baseballs required for this goal, this value should return 2.
        int numReqItemsInInventory = inventory.SearchInventory(RequiredItemName);

        Debug.Log("After searching for quest items, I found you already had " + numReqItemsInInventory + " " + RequiredItemName + "'s");


        //call this.CurrentAmount++ depending on the value of numReqItemsInInventory
        for (int i = 0; i < numReqItemsInInventory; i++)
        {
            IncrementCurrentAmount();
        }
    }