【UGUI】无限循环列表和InputField.onValueChanged 事件

先看一下效果

其中应用了InputField.onValueChanged  属于像浏览器那种实施搜索


其中有一些 UI相关代码 可以看主要的 循环操作

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System;
using System.Text.RegularExpressions;
using DG.Tweening;
/// 
/// Select 查询模块
/// 
public class SelectWindow : UIWindowTween
{
    private Button _selectButton;
    private Button _closeButton;
    private InputField _selectInputField;
    [SerializeField]
    private GameObject pre;
    [SerializeField]
    private Scrollbar rect;
    public ScrollRect _selectScroll;
    //储存了所有的查找到的 物体
    public List mainObj = new List();
    public List mainPos = new List();
    private List seleButtonList = new List();
    private System.Action OnspawnSelectOBJ;

    /// 
    /// 列表循环
    /// 
    /// 
    /// 
    //只会出现10item
    public int maxNum = 10;
    private int number = 0;
    private int allNumber;
    //content
    [SerializeField]
    private Transform content;
    //group
    public GridLayoutGroup gird;

    //protected List preList = new List();
    用于储存总数
    //protected int preListLength;
    //第一个物体
    public Transform fristChild;
    //三个物体的高
    private float heightTop;
    //两个物体的高
    private float heightBottom;

    private int count;

    private bool load3DUI = false;
    public GameObject pre3DUI;

    private LookTarget jiantou;
    private Target3DUI target_3DJianToul;

    private GameObject targetTemp = null;
    //显示面板
    [SerializeField]
    public GameObject bg;
    protected override void SetWindowUnit(WindowType type = WindowType.Alone, WindowMode mode = WindowMode.Normal)
    {
        base.SetWindowUnit(type, mode);
    }
    /// 
    /// 初始化监听
    /// 
    public override void Initialize()
    {
        base.Initialize();
        _selectButton = transform.Find("BackGround/SelectButton").GetComponent