public void LoadData(ISaveService sc) { isAlive = sc.LoadInt(this.gameObject, "stats.isAlive") == 1? true : false; health = sc.LoadInt(this.gameObject, "stats.health"); if (isAlive == false){ //deactivate dead character to prevent death animation from replaying on load this.gameObject.SetActive(false); anim.SetBool(HashIDs.isAliveBool, false); } }
public void LoadData(ISaveService sc) { items = new List<InventoryItem>(); int count = sc.LoadInt(this.gameObject, "inventory.count"); for (int i = 0; i< count; i++){ string name = sc.LoadString(this.gameObject, "inventory.items."+ i +".name"); int amount = sc.LoadInt(this.gameObject, "inventory.items."+ i +".amount"); InventoryItem it = InventoryItem.FromString(name); it.amount = amount; items.Add(it); } }
private int activeWeapon = 0; //Index of the currently equipped weapon #endregion Fields #region Methods public void LoadData(ISaveService sc) { SelectWeapon(sc.LoadInt(this.gameObject, "equipped_weapon")); //Last minute hotfix if (activeWeapon == elementStaff) InventoryItem.FromString(InventoryItem.staff).Use(); }
public int quantity = 0; //the amount of items that the player receives #endregion Fields #region Methods public void LoadData(ISaveService sc) { item = sc.LoadString(owner, "pickup.item"); quantity = sc.LoadInt(owner, "pickup.quantity"); }