Пример #1
0
    public void EvaluateQuestCompletion()
    {
        bool allTrue = true;

        foreach (var quest in profileData.quests)
        {
            if (!FlagRepository.ReadQuestKey(quest.ToString()))
            {
                allTrue = false;
                break;
            }
        }
        if (allTrue)
        {
            badgeImage.sprite = spriteBadgeComplete;
        }
    }
Пример #2
0
 public void CheckConditions()
 {
     isUsable = true;
     if (items.Count > 0)
     {
         foreach (var item in items)
         {
             if (!Inventory.instance.InventoryHas(item.name))
             {
                 isUsable = false;
                 break;
             }
         }
     }
     if (quests.Count > 0)
     {
         foreach (var quest in quests)
         {
             if (!FlagRepository.ReadQuestKey(quest.ToString()))
             {
                 isUsable = false;
                 break;
             }
         }
     }
     if (secrets.Count > 0)
     {
         foreach (var secret in secrets)
         {
             if (FlagRepository.ReadSecretKey(secret.ToString()) < 1)   //Secret hasn't been found
             {
                 isUsable = false;
                 break;
             }
         }
     }
     outline.color = isUsable ? colorOpen : colorLocked;
 }