public void init (BlacksmithScreen blacksmithScreen) { this.blacksmithScreen = blacksmithScreen; backBtn = transform.Find("BackBtn").GetComponent<Button>(); inventoryManipulator = GetComponent<InventoryManipulator>(); inventoryManipulator.init(new List<EquipmentHolder>()); gameObject.SetActive(false); }
public void init () { Transform equipments = transform.Find("EquipmentHolders"); equipments.gameObject.SetActive(true); EquipmentHolder holder; for (int i = 0; i < equipments.childCount; i++) { holder = equipments.GetChild(i).GetComponent<EquipmentHolder>(); holder.init(this); equipmentHolders.Add(holder); } potionBag = Vars.gameplay.getPotionBag(); foreach (PotionHolder pHolder in potionBag.getPotionHolders()) { equipmentHolders.Add(pHolder); } inventoryManipulator = GetComponent<InventoryManipulator>(); inventoryManipulator.init(equipmentHolders); Transform attributes = transform.Find("Attributes"); damageValue = attributes.Find("DamageValue").GetComponent<StrokeText>(); armorValue = attributes.Find("ArmorValue").GetComponent<StrokeText>(); strengthValue = attributes.Find("StrengthValue").GetComponent<StrokeText>(); enduranceValue = attributes.Find("EnduranceValue").GetComponent<StrokeText>(); agilityValue = attributes.Find("AgilityValue").GetComponent<StrokeText>(); luckValue = attributes.Find("LuckValue").GetComponent<StrokeText>(); setLayersForText(attributes); addAttributes = attributes.Find("AddAttributes").GetComponent<AddAttributes>(); addAttributes.init(); transform.Find("BG").gameObject.SetActive(true); attributes.gameObject.SetActive(true); gameObject.SetActive(false); }