using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class EquipmentInfo : MonoBehaviour { public static EquipmentInfo main; [SerializeField] private Text localName; [SerializeField] private Text desqription; [SerializeField] private Image icon; [SerializeField] private Button AddButton; private void Awake() { if (main != null && main != this) { Debug.LogWarning("2 dataholders on the scene"); Destroy(this); return; } main = this; } private void Start() { CardAbout(0); } public void CardAbout(int _index) { localName.text = Inventory.main.allEquipment[_index].GetComponent().equipmentConfig.equipmentCharacteristics.name; desqription.text = Inventory.main.allEquipment[_index].GetComponent().equipmentConfig.equipmentCharacteristics.description; icon.sprite = Inventory.main.allEquipment[_index].GetComponent().equipmentConfig.equipmentCharacteristics.sprite; if (Inventory.main.EquipedOrNot(Inventory.main.lastCardNum)) AddButton.GetComponentInChildren().text = "UnEquip"; else AddButton.GetComponentInChildren().text = "Equip"; } }