public void LoadFromInventoryData(ItemStashData data) { if (data != null) { base.LoadFromData(data); this.isDisplaying = false; } }
public override void Save() { if (independent) { ItemStashData data = new ItemStashData(this); GameManager.Save(data, base.filename); } }
public override void Load() { base.Load(); if (independent) { ItemStashData data = GameManager.Load <ItemStashData>(base.filename); LoadFromInventoryData(data); } }
public override void Load() { base.Load(); ItemStashData data = GameManager.Load <ItemStashData>(base.filename); if (data != null) { base.LoadFromData(data); for (int i = 0; i < base.capacity; i++) { itemSlots[i].SetItem(base.items[i], this); } } }
public NPCData(NPC npc) : base(npc) { inventoryData = new ItemStashData(npc.GetInventory()); destX = npc.GetDestination().x; destY = npc.GetDestination().y; destZ = npc.GetDestination().z; this.name = npc.GetName(); this.hasQuest = npc.hasQuest; this.questActive = npc.questActive; this.friendliness = npc.GetFriendliness(); this.isMoving = npc.isMoving; this.canSearchForDest = npc.canSearchForDest; this.visible = npc.visibleByCamera; }
public void LoadFromData(ItemStashData data) { this.count = data.count; this.capacity = data.capacity; ItemData[] itemData = data.itemData; for (int i = 0; i < capacity; i++) { if (itemData[i] == null) { items[i] = null; } else { items[i] = ItemManager.instance.GetItem(itemData[i].itemName); items[i].quality = itemData[i].itemQuality; } } }
public void LoadFromData(NPCData data) { if (data == null) { return; } base.LoadFromData(data); ItemStashData inventoryData = data.inventoryData; inventory.LoadFromInventoryData(inventoryData); npcName = data.name; name = Constants.NPC_NAME + npcName; hasQuest = data.hasQuest; questActive = data.questActive; if (hasQuest && !questActive) { interactable.ShowQuestIcon(); } friendliness = data.friendliness; destination = new Vector3(data.destX, data.destY, data.destZ); isMoving = data.isMoving; canSearchForDest = data.canSearchForDest; UpdateSortingLayer(); if (isMoving) { SetNewDestination(destination); } else if (!canSearchForDest) { StartCoroutine(ArriveDelay()); } }