using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class CosmeticHover : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { public GameObject image; private AudioSource audioSource; private Animator animator; public AudioClip[] audioclips; [SerializeField] private GameObject[] ItemButtons; private CharCreationUIManager charCreation; private CosmeticItem cosmeticItem; private void Start() { charCreation = Object.FindObjectOfType(); cosmeticItem = GetComponentInParent(); audioSource = GetComponent(); animator = GetComponent(); } private void Update() { } private void playHoverSound() { audioSource.clip = audioclips[0]; audioSource.Play(); } public void click() { audioSource.clip = audioclips[1]; audioSource.Play(); } public void BuyButton() { charCreation.CreateCosmeticPopUp("ZakupiƦ Przedmiot?", "Czy na pewno chcesz zakupiƦ ten przedmiot?", delegate { Debug.Log("Zakupiono Przedmiot"); }); } private void CantBuy() { animator.SetTrigger("cantbuy"); } public void OnPointerEnter(PointerEventData eventData) { if (Singleton.Instance.GetCurrentPlayerData().PlayerLevel >= cosmeticItem.Itemlevel) { image.gameObject.SetActive(value: true); for (int i = 0; i < ItemButtons.Length; i++) { ItemButtons[i].SetActive(value: false); } playHoverSound(); ItemButtons[0].SetActive(value: true); if (charCreation.RenderPopUp != null) { ItemButtons[0].GetComponent