public virtual void Initialize() { this.transform.position = new Vector3(this.transform.position.x, Constants.HeroYpos, 0); hPcurrent = HPBars; Inventory = new AbItem[Constants.InventorySize]; Equipment = new AbEquipment[Enum.GetNames(typeof(EquipmentTypes)).Length]; Animator = this.gameObject.GetComponent<Animator>(); AudioPlayer = this.gameObject.GetComponent<AudioController>(); Statistics = new AdventureResult(); }
public void Equip(AbItem item) { if (item.Type == ItemType.Equipment) { this.Equipment[(int)(item as AbEquipment).Slot] = item as AbEquipment; } }