/*Public consts fields*/

        /*Public fields*/

        /*Private methods*/

        /// <summary>
        /// Set values of text component with information about worker
        /// </summary>
        private void SetWorkerText()
        {
            TextName.text = UIWorkers.GetWorkerNameString(SelectedWorker);
            SetWorkerAbilitiesText();
            TextSalary.text        = UIWorkers.GetWorkerSalaryString(SelectedWorker);
            TextExpierience.text   = UIWorkers.GetWorkerExpierienceString(SelectedWorker);
            TextDaysInCompany.text = UIWorkers.GetWorkerDaysInCompanyString(SelectedWorker);
            TextSatisfaction.text  = UIWorkers.GetWorkerSatisfactionString(SelectedWorker);
        }
        private void SetWorkerInfoText(SharedWorker selectedWorker)
        {
            if (null != selectedWorker)
            {
                TextName.text        = UIWorkers.GetWorkerNameString(selectedWorker);
                TextSalary.text      = UIWorkers.GetWorkerSalaryString(selectedWorker);
                TextExpierience.text = UIWorkers.GetWorkerExpierienceString(selectedWorker);

                TextAbilities.text = UIWorkers.GetWorkerAbilitiesString(selectedWorker);
                RectTransform textTransform = TextAbilities.rectTransform.parent.GetComponent <RectTransform>();
                textTransform.sizeDelta = new Vector2(textTransform.sizeDelta.x, TextAbilities.preferredHeight);
            }
            else
            {
                TextName.text        = string.Empty;
                TextSalary.text      = string.Empty;
                TextAbilities.text   = string.Empty;
                TextExpierience.text = string.Empty;
            }
        }
Esempio n. 3
0
        private void SetWorkerInfoText(SharedWorker selectedWorker)
        {
            if (null != selectedWorker)
            {
                TextName.gameObject.SetActive(true);
                TextSalary.gameObject.SetActive(true);
                TextAbilities.gameObject.SetActive(true);
                TextExpierience.gameObject.SetActive(true);

                TextName.text = UIWorkers.GetWorkerNameString(selectedWorker);
                SetWorkerSalaryText(selectedWorker);
                TextExpierience.text = UIWorkers.GetWorkerExpierienceString(selectedWorker);
                TextAbilities.text   = UIWorkers.GetWorkerAbilitiesString(selectedWorker);
                RectTransform textObjectTransform = TextAbilities.transform.parent.GetComponent <RectTransform>();
                textObjectTransform.sizeDelta = new Vector2(textObjectTransform.sizeDelta.x, TextAbilities.preferredHeight);
            }
            else
            {
                TextName.gameObject.SetActive(false);
                TextSalary.gameObject.SetActive(false);
                TextAbilities.gameObject.SetActive(false);
                TextExpierience.gameObject.SetActive(false);
            }
        }
 private void OnSelectedWorkerExpierienceTimeChanged(SharedWorker companyWorker)
 {
     TextExpierience.text = UIWorkers.GetWorkerExpierienceString(companyWorker);
 }