public void GetData(HealingItemObject hio, GameObject[] ItemSlots, int slotNr) { GetComponent <Image>().sprite = hio.texture; itemName = hio.itemName; id = hio.name; healPower = hio.healPower; itemDescrip = hio.description; this.ItemSlots = ItemSlots; held = false; slotRect = GetComponent <Image>().sprite.rect; this.slotNr = slotNr; moveParent = GameObject.FindGameObjectWithTag("LoadManager").transform; }
private void GetEquipment() { weaponId = characterScript.rangedId; if (weaponId != "" || weaponId != null) { foreach (WeaponObject weapon in Assets.assets.weaponTemp) { if (weapon.name == weaponId) { this.weapon = weapon; } } } else { weapon = null; } healingId = characterScript.healingId; if (healingId != "" || healingId != null) { foreach (HealingItemObject healingItem in Assets.assets.healingTemp) { if (healingItem.name == healingId) { this.healingItem = healingItem; } } } else { healingItem = null; } combatId = characterScript.combatId; if (combatId != "" || combatId != null) { foreach (CombatItemObject combatItem in Assets.assets.combatTemp) { if (combatItem.name == combatId) { this.combatItem = combatItem; } } } else { combatItem = null; } }
public void GetItem(GameObject Character, GameObject pivotCharacter) { if (Character != null) { this.Character = Character; this.pivotCharacter = pivotCharacter; healingItem = Character.GetComponent <Abilities>().healingItem; if (healingItem != null) { GetComponent <Image>().sprite = healingItem.icon; } else { GetComponent <Image>().sprite = defultSprite; } } else { GetComponent <Image>().sprite = defultSprite; } }
private void Start() { healingItem = null; }