using Assets.Scripts; using Assets.Scripts.Apis; using Assets.Scripts.Apis.Models; using DG.Tweening; using Newtonsoft.Json.Linq; using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; public class ResultListController : PFUIPanel { [SerializeField]Transform routeResult; Transform localRouteItem; Transform scrollContent; Transform routeScroll, matchScroll, rowerScroll; Transform routeContent, matchContent, rowerContent; Transform btnRoute, btnMatch ,btnRower, searchInput; Color c1, c2; // Start is called before the first frame update int pageSize = 20; string name = ""; Transform[] contents,scrolls,btns; Dictionary filterOptionDict = new Dictionary { {0,"routes" },{1,"competition" } }; //交互用 public Transform currentItem { get; set; } int scrollIndex = 0; ScrollRect scroll; void Awake() { //ApiBase.SetCookie("73385F5F719B610D132C1ECF3E9143272BF15214D57ED91CD7A9DFD832407471535112AAEB8E9271F75D54FBBF2D99F18FA313C1EEA5676F5D722D7FBB07C926BEC5905591BF9AFDDC6336552DF273112C2DA1794E6FA2F465B11FECD2E82E52"); localRouteItem = Resources.Load("UI/Prefab/ResultList/LocalRouteItem"); caches = new Dictionary(); #if UNITY_ANDROID || UNITY_IOS routeResult = Resources.Load("UI/Prefab/ResultList/RouteItem-Mobile"); localRouteItem = Resources.Load("UI/Prefab/ResultList/LocalRouteItem-Mobile"); #endif InitialColor(); scroll = transform.Find("ListPanel").Find("Scroll").GetComponent(); btnMatch = transform.Find("ListPanel").Find("BtnMatch"); btnRoute = transform.Find("ListPanel").Find("BtnRoute"); btnRower = transform.Find("ListPanel").Find("BtnRower"); searchInput = transform.Find("ListPanel").Find("SearchInput"); scrollContent = scroll.transform.Find("Viewport").Find("Content"); routeScroll = scrollContent.Find("RouteList"); routeContent = routeScroll.Find("Viewport").Find("Content"); matchScroll = scrollContent.Find("MatchList"); matchContent = matchScroll.Find("Viewport").Find("Content"); rowerScroll = scrollContent.Find("RowerList"); if (rowerScroll) { rowerContent = rowerScroll.Find("Viewport").Find("Content"); } contents = new Transform[] { routeContent, matchContent, rowerContent}; if (btnRoute != null) { UIManager.AddEvent(btnRoute.gameObject, EventTriggerType.PointerClick, (b) => { StartScroll(0); }); //btnRoute.GetComponent