示例#1
0
        void LoadNextUpgradeData(Management.Hospital.BaseDepartment baseDepartment)
        {
            try
            {
                upgradeContent = baseDepartment.GetUpgradeContentFromLevel(hospitalDepartmentData.CurrLevel);
                int currLevelIndex = baseDepartment.DeaprtmentUpgradeJson.upgradable_contents.IndexOf(upgradeContent);
                Hospital.Json.UpgradableContent nextUpgradeContent = null;
                if (currLevelIndex < baseDepartment.DeaprtmentUpgradeJson.upgradable_contents.Count - 1)
                {
                    nextUpgradeContent = baseDepartment.DeaprtmentUpgradeJson.upgradable_contents[currLevelIndex + 1];
                }
                UpdateNextLevelUnlockValue(hospitalDepartmentData.CurrLevel + 1, baseDepartment.DeaprtmentUpgradeJson.base_income, uiHolder.StateController.DepartmentUpgradeScriptable.GetLevelIncreasePercentage(baseDepartment.DepartmentType));

                // This level upgrade
                txtDepartmentUpgradeRquiredValue.text = Utils.FormatWithMeasues(newLevelUnlockaValue);
                imgCurrUpgradeIcon.sprite             = uiHolder.StateController.DepartmentUpgradeScriptable.GetIconFromIndex(baseDepartment.DepartmentType, currLevelIndex);

                txtUpgradeTitle.text       = upgradeContent.upgrade_name;
                txtUpgradeDescription.text = upgradeContent.description;
                txtLevelValue.text         = hospitalDepartmentData.CurrLevel.ToString();

                txtBaseIncomeValue.text = baseDepartment.DeaprtmentUpgradeJson.base_income.ToString();
                txtTreatmentTime.text   = upgradeContent.time.ToString();
                UpdateStaffUI();

                //Staff salary
                txtStaffSalaryMax.text = baseDepartment.MaxCanReduceWorkTimeByPercent.ToString() + "%";
                UpdateSalryHikeUI(baseDepartment);

                txtPatientTreated.text = (60 / (int)upgradeContent.time).ToString() + "/Min";

                //Next Upgrade
                if (nextUpgradeContent != null)
                {
                    txtNextUpgradeIncome.text     = "X" + nextUpgradeContent.income_multiplyer.ToString();
                    txtNextUpgradeLevelValue.text = nextUpgradeContent.level.ToString();

                    sliderNextUpgrade.minValue = upgradeContent.level;
                    sliderNextUpgrade.maxValue = nextUpgradeContent.level;
                    sliderNextUpgrade.value    = hospitalDepartmentData.CurrLevel;
                }
                else
                {
                    txtNextUpgradeIncome.text     = "-";
                    txtNextUpgradeLevelValue.text = "-";

                    sliderNextUpgrade.minValue = 0;
                    sliderNextUpgrade.maxValue = 0;
                    sliderNextUpgrade.value    = 0;
                }

                ToggleAllButtons(true);
            }
            catch (System.Exception e)
            {
                ToggleAllButtons(false);
                Debug.LogError("Department upgrade data load failed");
                Debug.LogError(e.Message.ToString());
            }
        }
示例#2
0
        void UpdateSalryHikeUI(Management.Hospital.BaseDepartment baseDepartment)
        {
            sliderStaffSalaryHike.value = hospitalDepartmentData.SalaryIncreaseIndexCount / baseDepartment.MaxCanReduceWorkTimeByPercent;
            float costForNextSalaryHike = baseDepartment.DeaprtmentUpgradeJson.salary_initial_cost * (hospitalDepartmentData.SalaryIncreaseIndexCount + 1);

            btnStaffSalary.interactable      = UiHolder.StateController.GameManager.MasterLoader.PlayerScoreModel.IsEnoughCash(costForNextSalaryHike);
            txtStaffSalaryRequiredValue.text = Utils.FormatWithMeasues((decimal)costForNextSalaryHike);
        }
示例#3
0
 public void ShowInfoTab(Management.Hospital.Scriptable.DepartmentUpgradeIconDataScriptable iconScriptable, Management.Hospital.BaseDepartment baseDepartment)
 {
     gameObject.SetActive(true);
     scrollbar.value = 0;
     for (int i = 0; i < baseDepartment.DeaprtmentUpgradeJson.upgradable_contents.Count; ++i)
     {
         UiDepartmentInfoPanelDataHolder dataHolderInstance = Instantiate(dataHolderPrefab, container);
         dataHolderInstance.UpdateData(iconScriptable.Icons[i], i + 1, baseDepartment.DeaprtmentUpgradeJson.upgradable_contents[i].income_multiplyer);
     }
 }
示例#4
0
        void UpdateStaffCost(Management.Hospital.BaseDepartment baseDepartment)
        {
            int upcomingStaffHireCount = uiHolder.StateController.GameManager.MasterLoader.HospitalDepartmentSaveModel.GetTotalStaffCount(baseDepartment.DepartmentType) + 1;
            int upcomingSalaryIndex    = uiHolder.StateController.GameManager.MasterLoader.HospitalDepartmentSaveModel.GetSalaryIndex(baseDepartment.DepartmentType) + 1;

            switch (baseDepartment.DepartmentType)
            {
            case Hospital.Core.DepartmentType.ENT:
                employeeSalaryCost = (departmentStaffAndSalaryData.ENTSalaryHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.ENTSalaryHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.DENTIST:
                employeeSalaryCost = (departmentStaffAndSalaryData.DentalSalayHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.DentalHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.SURGEON:
                employeeSalaryCost = (departmentStaffAndSalaryData.SurgeonSalayHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.SurgeonHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.GYNAECOLOGIST:
                employeeSalaryCost = (departmentStaffAndSalaryData.GynecologySalaryHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.GynecologySalaryHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.PAEDIATRICS:
                employeeSalaryCost = (departmentStaffAndSalaryData.PaediatricsSalaryHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.PaediatricsSalaryHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.EYE_SPECILIST:
                employeeSalaryCost = (departmentStaffAndSalaryData.EyeSalaryHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.EyeSalaryHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.ORTHOPAEDICS:
                employeeSalaryCost = (departmentStaffAndSalaryData.OrthopedicsSalayHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.OrthopedicsHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.NEUROLOGIST:
                employeeSalaryCost = (departmentStaffAndSalaryData.NurologySalayHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.NurologyHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.CARDIOLOGIST:
                employeeSalaryCost = (departmentStaffAndSalaryData.CardiologySalaryHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.CardiologySalaryHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.PSYCHIATRIST:
                break;

            case Hospital.Core.DepartmentType.SKIN_SPECIALIST:
                employeeSalaryCost = (departmentStaffAndSalaryData.SkinSalayHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.SkinHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.V_D:
                break;

            case Hospital.Core.DepartmentType.PLASTIC_SURGEON:
                employeeSalaryCost = (departmentStaffAndSalaryData.PlasticSurgenSalaryHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.PlasticSurgenSalaryHikeMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.PHARMASY:
                employeeSalaryCost = (departmentStaffAndSalaryData.PharmacySalaryHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.PharmacySalaryHikeCostMultiplyBy;
                employeeHireCost   = (departmentStaffAndSalaryData.PharmacyStaffHireBaseCost * upcomingStaffHireCount) * departmentStaffAndSalaryData.PharmacyStaffHireCostMultiplyBy;
                break;

            case Hospital.Core.DepartmentType.CONSULTATION_FEES:
                employeeSalaryCost = (departmentStaffAndSalaryData.ConsulationSalaryHikeBaseCost * upcomingSalaryIndex) * departmentStaffAndSalaryData.ConsulationSalaryHikeCostMultiplyBy;
                employeeHireCost   = (departmentStaffAndSalaryData.ConsulationStaffHireBaseCost * upcomingStaffHireCount) * departmentStaffAndSalaryData.ConsulationStaffHireCostMultiplyBy;
                break;
            }

            txtStaffSalaryRequiredValue.text  = Utils.FormatWithMeasues((decimal)employeeSalaryCost);
            txtHireEmployeeRequiredValue.text = Utils.FormatWithMeasues((decimal)employeeHireCost);

            btnHireEmployee.interactable = UiHolder.StateController.GameManager.MasterLoader.PlayerScoreModel.IsEnoughCash(employeeHireCost);
            btnStaffSalary.interactable  = UiHolder.StateController.GameManager.MasterLoader.PlayerScoreModel.IsEnoughCash(employeeSalaryCost);
        }