// Start is called before the first frame update void Start() { questInventory = QuestInventory.instance; questInventory.onQuestChangedCallback += updateUI; slots = questParent.GetComponentsInChildren <QuestsSlot>(); }
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(); } }
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(); }
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); } }
// 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); }
void Awake() { instance = this; }