public void Equip() { thisPanel.SetActive(false); GameObject target = null; if (gameItem.GetItemType() == "Personal Weapon") { target = crewEquip; } else if (gameItem.GetItemType() == "Ship Weapon") { target = shipEquip; EquipShipManager script = target.GetComponent <EquipShipManager>(); script.weaponEquipping = (ShipWeapon)gameItem; } if (!target) { return; } target.SetActive(true); }
void Start() { managerScript = thisPanel.GetComponent <EquipShipManager>(); thisButton.onClick.AddListener(OnClickEquip); }