예제 #1
0
        private void SpawnButton(string sectionName)
        {
            GameObject buttonGo = Instantiate(buttonPointerPrefab, buttonsParent.transform, false);

            //установить текст
            Text text = buttonGo.transform.Find("Text").GetComponent <Text>();

            text.text = sectionName;

            //установить слушатель
            Button button = buttonGo.transform.GetComponent <Button>();

            button.onClick.AddListener(() =>
            {
                scrollViewSmoothMovement.StartMovement(sectionName);
            });
        }
예제 #2
0
        public void ShowError(SectionTypeEnum sectionTypeEnum)
        {
            //скрыть меню подтверждения покупки
            lobbyEcsController.ClosePurchaseConfirmationWindow();
            //начать перелистывать на раздел с валютой
            scrollViewSmoothMovementBehaviour.StartMovement(sectionTypeEnum);
            //todo показать всплывающий текст ошибки

            switch (sectionTypeEnum)
            {
            case SectionTypeEnum.SoftCurrency:
                textTooltip.Show("Not enough coins.");
                break;

            case SectionTypeEnum.HardCurrency:
                textTooltip.Show("Not enough gems.");
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(sectionTypeEnum), sectionTypeEnum, null);
            }
        }