Ejemplo n.º 1
0
        private void SetEventListener(Button btn, EntityType workerType)
        {
            btn.onClick.AddListener(() =>
            {
                var(employedPlaces, countEmployedPlaces) = building.BuildingData.GetCountOfEmployed(workerType);
                if (employedPlaces < countEmployedPlaces)
                {
                    signalBus.Fire(new ApplyEmployeeSignal
                    {
                        employeeType = workerType
                    });
                    UpdateEmployeeWorkers(uiData.GetEmployeesCountLabel(workerType.ToString()), workerType);

                    signalBus.Fire(new UpdateUIWindow());
                }
            });
        }