using Assets.Scripts; using Assets.Scripts.Apis.Models; using DG.Tweening; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UI; public class BannerController : MonoBehaviour { // Start is called before the first frame update private List itemList; private List standardPositions; private List list; private int currentIndex = 1; private Dictionary caches; void Awake() { itemList = new List { transform.Find("1").GetComponent(), transform.Find("2").GetComponent(), transform.Find("3").GetComponent() }; caches = new Dictionary(); standardPositions = new List { transform.Find("1").localPosition,transform.Find("2").localPosition,transform.Find("3").localPosition }; AddTouchEvent(); Debug.Log(standardPositions[0]); Debug.Log(standardPositions[1]); Debug.Log(standardPositions[2]); } TKPanRecognizer pan; private void AddTouchEvent() { pan = new TKPanRecognizer(); var panList = new List(); pan.gestureRecognizedEvent += (r) => { if (!App.currentPageIsHome) return; int center = GetCenterIndex(), left = GetSideIndex(true), right = GetSideIndex(false); if (!(center == -1 || left == -1 || right == -1) && panList.Count == 0) { panList.Add(itemList[left]); panList.Add(itemList[center]); panList.Add(itemList[right]); } if (panList.Count == 0) return; var startPoint = r.startTouchLocation(); if (((RectTransform)transform).isPointInTransfrom(startPoint)) { foreach (var item in panList) { item.GetComponent