Пример #1
0
 private void OnEnable()
 {
     if (isNotReady)
     {
         buttons  = ButtonsObject.GetComponentsInChildren <Button>();
         counters = ButtonsObject.GetComponentsInChildren <Text>();
         borders  = ButtonsObject.GetComponentsInChildren <Outline>();
         slots    = ButtonsObject.GetComponentsInChildren <BagSlotSync>();
         TitleTextObject.GetComponent <Text>().text = Localization.Current.WindowNames[1].ToUpper();
         CloseButtonObject.GetComponent <Button>().onClick.AddListener(delegate { gameObject.SetActive(false); });
         QuestionButtonObject.GetComponent <Button>().onClick.AddListener(delegate {
             // to do
         });
         isNotReady = false;
         RefreshItems();
     }
 }
Пример #2
0
 private void OnEnable()
 {
     if (isNotReady)
     {
         characteristicValuesText = CharacteristicValuesObject.GetComponent <Text>();
         WindowTitleObject.GetComponent <Text>().text        = Localization.Current.WindowNames[3].ToUpper();
         CharacteristicKeysObject.GetComponent <Text>().text = Player.Current.CurrentCharacteristic.GetNames();
         var statsTexts = StatsObject.GetComponentsInChildren <Text>();
         var sliders    = StatsObject.GetComponentsInChildren <Slider>();
         expSlider   = sliders[0];
         levelSlider = sliders[1];
         for (int i = 0; i < 5; i++)
         {
             statsTexts[i].text = Localization.Current.StatNames[i];
         }
         statPlayerName   = statsTexts[5];
         statCalendarDate = statsTexts[6];
         statPlayerMoney  = statsTexts[7];
         CloseButtonObject.GetComponent <Button>().onClick.AddListener(delegate { gameObject.SetActive(false); });
         isNotReady = false;
     }
     statPlayerName.text  = Player.Current.Name;
     statPlayerMoney.text = Player.Current.Money.ToString();
 }