// Use this for initialization void Start() { mAddBtn.onClick.AddListener(() => { mNum = mNum + mAddNum; for (int i = 0; i < mNum; i++) { mTypeList.Add(Random.Range(0, 2)); } mLoopRect.Init(mNum, (t, t1) => { t.Get <TextMeshProUGUI>("b_text").text = t1.ToString(); }); }); mReduceBtn.onClick.AddListener(() => { mNum = mNum - mReduceNum; mLoopRect.Init(mNum, (t, t1) => { t.Get <TextMeshProUGUI>("b_text").text = t1.ToString(); //Debug.Log(t1); }); }); }
void Start() { _scrollRect = GetComponent <LoopScrollRect>(); var dataSource = new LoopScrollPrefabSource(); dataSource.prefabName = ObjectResourceName; _scrollRect.Init(dataSource, LoopScrollSendIndexSource.Instance); for (int i = 0; i < totalCount; i++) { _scrollRect.AddItem((object)i, false); } _scrollRect.RefillCells(); }
private static void OutputUI(string message) { if (!IsOutputTarget(OutputTarget.eUI)) { return; } if (uiLogList.Count >= UI_MAX_LOG_NUM) { uiLogList.Clear(); } uiLogList.Add(message); if (wrapContent != null) { wrapContent.Init(uiLogList.Count, (obj, index) => { //Text text = obj.GetComponent<Text>(); //text.text = uiLogList[index]; }); } }