using Assets.Scripts; using Assets.Scripts.Apis.Models; using Assets.Scripts.UI.UIEffect; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class Item : PFUIPanel, IPointerEnterHandler, IPointerExitHandler, IPointerUpHandler { private Text text; private string Text { get { return text.text; } set { text.text = value; } } private Text km; private string Distance { get { return km.text; } set { km.text = value; } } private Text count; private string Count { get { return count.text; } set { count.text = value; } } public Action onClick; private Transform hot; protected override void Awake() { text = this.transform.Find("name").GetComponent(); km = this.transform.Find("km").GetComponent(); count = this.transform.Find("count").GetComponent(); Material material = null; if (material == null) { material = Instantiate(Resources.Load("UI/Material/RoundedCornersTextureMaterial")); } var rect = ((RectTransform)transform).rect; #if UNITY_ANDROID || UNITY_IOS material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, 10, 0)); #else material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height * 0.5f, 0)); #endif this.GetComponent().material = material; hot = this.transform.Find("Hot"); SetRounded(hot, 17); //UIManager.AddEvent(this.gameObject, EventTriggerType.PointerClick, OnPointerClick); transform.GetComponent