using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; namespace SimpleInventorySystem { public class InspectionWindowUI : WindowUI { public TextMeshProUGUI categoryText; public TextMeshProUGUI WeightText; public Button DropButton; public GameObject ItemTraitPrefab; public TextMeshProUGUI ShortDescriptionText; // Start is called before the first frame update void Start() { if (dragWindowUI != null) { dragWindowUI.title.text = ItemUI.itemName; } if(categoryText != null) { categoryText.text = $"{ItemUI.category} > {ItemUI.subCategory}"; } if (WeightText != null) { WeightText.text = $"{ItemUI.weight} Lbs"; } if(ShortDescriptionText != null) { ShortDescriptionText.text = $"{ItemUI.shortDescription}"; } if (DropButton != null) { DropButton.onClick.AddListener(DropItem); } } public void DropItem() { Debug.Log("Drop"); if (ItemUI != null) { ItemUI.DropItemAway(); CloseInspectionWindow(); } } public void CloseInspectionWindow() { if (DropButton != null) { DropButton.onClick.RemoveListener(DropItem); } dragWindowUI.CloseWindow(); } // Update is called once per frame void Update() { } } }