protected override void OnShown() { _components.RemoveChildrenToPool(); { AccesoryView obj = (AccesoryView)_components.AddItemFromPool(); obj.setUneuip(nowComponent); obj.onClick.Set(delegate() { _components.ClearSelection(); obj.selected = true; choose = -1; changeDetailView(); }); } int idx = 0; foreach (TowerComponent tc in PlayerData.getInstance().bagComponents) { AccesoryView obj = (AccesoryView)_components.AddItemFromPool(); obj.updateView(tc); int ii = idx; obj.onClick.Set(delegate() { _components.ClearSelection(); obj.selected = true; choose = ii; changeDetailView(); }); idx++; } }
protected override void OnShown() { _components.RemoveChildrenToPool(); //_components.numItems = 3; for (int i = 0; i < componentsToSell.Count; i++) { AccesoryView obj = (AccesoryView)_components.AddItemFromPool(); obj.updateView(componentsToSell[i]); int idx = i; obj.onClick.Set(delegate() { _components.ClearSelection(); obj.selected = true; componentChoice = idx; changeDetailView(); }); } }