/// <inheritdoc/> protected override void UpdateViewsHolder(MyItemViewsHolder newOrRecycled) { // Initialize the views from the associated model ExampleItemModel model = _Params.Data[newOrRecycled.ItemIndex]; newOrRecycled.titleText.text = "[" + newOrRecycled.ItemIndex + "] " + model.title; }
IEnumerator FetchItemModelsFromServer(int count, Action <ExampleItemModel[]> onDone) { _Params.statusText.text = "Fetching " + count + " from server..."; // Simulating server delay yield return(new WaitForSeconds(DrawerCommandPanel.Instance.serverDelaySetting.InputFieldValueAsInt)); // Generating some random models var results = new ExampleItemModel[count]; for (int i = 0; i < count; ++i) { results[i] = new ExampleItemModel(); results[i].title = "Item got at " + DateTime.Now.ToString("hh:mm:ss"); } onDone(results); }