using Assets.Scripts; using Assets.Scripts.Apis; using Assets.Scripts.Apis.Models; using DG.Tweening; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.SceneManagement; using UnityEngine.UI; public class PropNames { public static List icons = new List { "icon1", "icon2", "icon3" }; public static List texts = new List { "DistanceText", "EleText", "SlopeText" }; public static Dictionary colorDict = new Dictionary { { true,"#ffffff"},{false,"#5c5c6e" } }; } public class MapItem : MonoBehaviour, IPointerExitHandler, IPointerEnterHandler,IPointerUpHandler { public bool isModal = false; float width; float height; void Awake() { width = this.GetComponent().rect.width; height = this.GetComponent().rect.height; } // Start is called before the first frame update //[SerializeField] Text text; //[SerializeField] GameObject panel; //[SerializeField] RawImage rawImage; void Start() { } // Update is called once per frame void Update() { } float? localY = null; MapRoute map; Dictionary caches; private MapRouteAreaItem area = null; private Action refresh = null; public void Initial(MapRoute myMap, Dictionary caches, MapRouteAreaItem area = null,Action refresh = null) { if (caches != null) { this.caches = caches; } this.area = area; this.refresh = refresh; map = myMap; //localY = transform.GetComponent().rect.height; //Debug.Log(localY); //UIManager.AddEvent(gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (Base) => //{ // UIManager.ShowMapDetailPanel(myMap.Id); //}); //UIManager.AddEvent(gameObject, UnityEngine.EventSystems.EventTriggerType.PointerEnter, (Base) => //{ // if (localY == null) // { // localY = transform.localPosition.y; // } // //transform.localPosition.Set(transform.localPosition.x,localY.Value+8, transform.localPosition.z); // //transform.DOLocalMoveY(localY.Value + 8, 0.5f); // //transform.domov(localY+8, 0.5f); //}); //UIManager.AddEvent(gameObject, UnityEngine.EventSystems.EventTriggerType.PointerExit, (Base) => //{ // //transform.localPosition.Set(transform.localPosition.x, localY.Value, transform.localPosition.z); // //transform.DOLocalMoveY(localY.Value, 0.5f); //}); //UIManager.AddEvent(transform.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, (Base) => //{ // App.RouteIdParam = myMap.Id; // if (!App.MainSceneParam.ContainsKey("Name")) // { // App.MainSceneParam.Add("Name", "MapListPanel"); // } // else // { // App.MainSceneParam["Name"] = "MapListPanel"; // } // SceneManager.LoadScene("Ride"); //}); if (!isModal) { transform.GetComponent