private void RemoveWorkerListViewElement(LocalWorker worker, ControlListView listView) { ListViewElementWorker element = UIWorkers.GetWorkerListViewElement(worker, listView); Button buttonComponent = element.GetComponent <Button>(); WorkersButtonsSelector.RemoveButton(buttonComponent); ListViewWorkers.RemoveControl(element.gameObject); worker.SatisfactionChanged -= OnWorkerSatisfactionChanged; }
private void RemoveWorkerListViewElement(SharedWorker worker, ControlListView listView) { ListViewElementWorker element = WorkerListViewMap.First(x => x.Key == worker).Value; Button buttonComponent = element.GetComponent <Button>(); listView.RemoveControl(element.gameObject); WorkerListViewMap.Remove(worker); WorkersButtonSelector.RemoveButton(buttonComponent); worker.SalaryChanged -= OnWorkerSalaryChanged; }
/// <summary> /// Disables list view element and returns it back to pool /// </summary> /// <param name="element"></param> private void DisablePlayerListViewElement(ListViewElementPhotonPlayer element) { ListViewPlayers.RemoveControl(element.gameObject, false); if (null == ListViewElementPool) { ListViewElementPool = new ObjectPool <ListViewElementPhotonPlayer>(); } element.gameObject.SetActive(false); ListViewElementPool.AddObject(element); }
private void RemoveWorkerListViewElement(SharedWorker worker, ControlListView listView) { if (null != WorkerListViewMap) { ListViewElementWorker element = WorkerListViewMap[worker]; Button buttonComponent = element.Button; WorkerListViewMap.Remove(worker); WorkersButtonSelector.RemoveButton(buttonComponent); listView.RemoveControl(element.gameObject); } }
private void RemoveWorkerListViewElement(ListViewElementWorker element, ControlListView listView) { listView.RemoveControl(element.gameObject, false); element.gameObject.SetActive(false); if (null == WorkerListViewElementsPool) { WorkerListViewElementsPool = new ObjectPool <ListViewElementWorker>(); } WorkerListViewElementsPool.AddObject(element); }
private void OnProjectsMarketProjectRemoved(SharedProject proj) { ListViewElementProject element = GetProjectListViewElement(ListViewMarketProjects, proj); if (null == ListViewElementPool) { ListViewElementPool = new ObjectPool <ListViewElementProject>(); } element.gameObject.SetActive(false); ListViewMarketProjects.RemoveControl(element.gameObject, false); ButtonSelectorProjects.RemoveButton(element.Button); ListViewElementPool.AddObject(element); SetListViewMarketProjectsText(); proj.CompletionTimeUpdated -= OnMarketProjectCompletionTimeUpdated; }