예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        questInventory = QuestInventory.instance;
        questInventory.onQuestChangedCallback += updateUI;

        slots = questParent.GetComponentsInChildren <QuestsSlot>();
    }
예제 #2
0
 public void SetQuest(int characterId, int questInventoryId)
 {
     if (_dbContext.QuestInventory.Where(q => q.CharacterId == characterId).Any(q => q.Id == questInventoryId))
     {
         QuestInventory questInventory = _dbContext.QuestInventory.SingleOrDefault(q => q.Id == questInventoryId);
         questInventory.QuestStatusId = _dbContext.QuestStatus.SingleOrDefault(s => s.Status == "active").Id;
         _dbContext.SaveChanges();
     }
 }
예제 #3
0
        public void CancelQuest(int characterId)
        {
            QuestInventory questInventory = _dbContext.QuestInventory.Where(q => q.CharacterId == characterId).SingleOrDefault(q => q.QuestStatus.Status == "active");

            questInventory.DamageDone    = 0;
            questInventory.DamageToday   = 0;
            questInventory.QuestStatusId = _dbContext.QuestStatus.SingleOrDefault(s => s.Status == "owned").Id;
            _dbContext.SaveChanges();
        }
예제 #4
0
    private void Awake()
    {
        if (instance != null)
        {
            Debug.Log("warning more than one instance of Questinventory");
            return;
        }

        instance = this;
    }
    public void SetQuestInventory(QuestInventory inventory)
    {
        HideAllItems();

        var itemNames = inventory.ItemNames();

        foreach (var itemName in itemNames)
        {
            Debug.Log("You are carrying:" + itemName);
            SetQuestItemEnabled(itemName, true);
        }
    }
예제 #6
0
    // Use this for initialization
    void Awake()
    {
        Application.runInBackground = true;
        //singleton
        if (ins == null)
        {
            ins = this;
        }
        else
        {
            if (ins != this)
            {
                Destroy(gameObject);
            }
        }
        DontDestroyOnLoad(gameObject);

        player          = GameObject.FindGameObjectWithTag("Player");
        playerInfo      = player.GetComponent <PlayerInfo>();
        playerInventory = playerInfo.inventory;
        playerSpells    = playerInfo.spellInventory;
        playerQuests    = player.GetComponent <QuestInventory>();
    }
 void SetupInventory(QuestInventory inventory, ICollection <string> inventoryItems)
 {
     inventory.SetItems(inventoryItems);
 }
예제 #8
0
 void Awake()
 {
     instance = this;
 }