private GList list; void Start() { mainUI = GetComponent<UIPanel>().ui; list = mainUI.GetChild("n0").asList; //n0是FairyGUI中的列表 list.SetVirtualAndLoop(); //把列表设置为虚拟列表(FGUI规定:如果使用列表,则必须使用虚拟列表) list.itemRenderer = RenderListItem; //调用list里面的渲染函数...
public void InitLoopScrollView(int count, List<ItemData> dataList){ this.count = count; datas = dataList; CreateContent(); CaculateMinCount(); CreateLoopObject(); UpdateContent(); scrollRect.onValueChanged.AddListener(OnScrolled); } void UpdateContent(){ for (int i = 0; i < loopObjectsLi...
public class UILoop1 : UIBase { enum Direction { Horizontal, Vertical } [SerializeField] private RectTransform m_Cell; [SerializeField] private Vector2 m_Page; [SerializeField] Direction direction = Direction.Horizontal; [SerializeField,Range(4,10)] private int m_BufferNo; private List<RectTransform...
框选功能 在框选时,还需要清除上一次框选的内容,因此我们使用一个List列表来记录当前框选的战斗单位,框选前遍历该列表来清除框选记录,完整代码如下: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 publicclassExample:MonoBehaviour{//光线渲染器组件privateLineRenderer lineRenderer;//屏幕坐标系起始点privateVe...
//卡片之间的间距//生成的卡片列表privatereadonly List<LoopScrollViewItem>itemList=newList<LoopScrollViewItem>();//字典用于存储各位置对应的卡片层级和坐标privatereadonly Dictionary<int,LoopScrollViewData>map=newDictionary<int,LoopScrollViewData>();privatevoidStart(){for(int i=0;i<roomTextures.Length;i...
_items.Clear();for(inti =0; i < generateCount; i++) { GameObject itemGameObject=_scrollViewOperate.InitScrollViewList(i); LoopScrollItem item=newLoopScrollItem(itemGameObject);floatitemY = -i *_itemHeight; item.RectTransform.anchoredPosition=newVector2(scrollRect.content.anchoredPosition.x, item...
Disable idle animations by disabling the Animator component (disabling the game object won't have the same effect). Avoid design patterns where an animator sits in a loop setting a value to the same thing. There's considerable overhead for this technique, with no effect on the application.Lea...
It indicates when to run, you can check PlayerLoopList.md to Unity's default playerloop and injected UniTask's custom loop.PlayerLoopTiming.Update is similar to yield return null in a coroutine, but it is called before Update(Update and uGUI events(button.onClick, etc...) are called on ...
{ soundValue = value; for (int i = 0; i < soundList.Count; ++i) soundList[i].volume = value; } /// /// 停止音效 /// public void StopSound(AudioSource source) { if( soundList.Contains(source) ) { soundList.Remove(source); source.Stop(); GameObject.Destroy(source); } ...
(ScrollListenerGListPageSelect); //我们模拟赋值 5*5 共25 for (int i = 0; i < 5; i++) //5行 { for (int j = 0; j < 5; j++) //5列 { GLoader gLoader= ListListThreeD.GetChildAt(i).asCom.GetChild("ContentList").asList.GetChildAt(j).asCom.GetChild("loader").asLoader;...