Beispiel #1
0
    private void Present(SkillBasicInformation basicInformation)
    {
        upgradeButton.onClick.RemoveAllListeners();

        previousTitlePair.SetText(string.Format("{0} (Lv. {1})", basicInformation.Name, basicInformation.AcquisitionLevel));
        previousTitlePair.SetSprite(basicInformation.Image);

        if (basicInformation.AcquisitionLevel == 0)
        {
            previousSkillDescription.text = "스킬을 습득하지 않았습니다.";
        }
        else
        {
            previousSkillDescription.text = basicInformation.DescriptionFunc(basicInformation.AcquisitionLevel);
        }

        previousMoneyText.text = LobbyManager.Instance.CurrentPlayer.Money.ToString();

        afterTitlePair.SetSprite(basicInformation.Image);

        if (basicInformation.AcquisitionLevel == basicInformation.MaximumLevel)
        {
            afterTitlePair.SetText(string.Format("{0} (Lv. {1})", basicInformation.Name, basicInformation.AcquisitionLevel));
            afterSkillDescription.text = basicInformation.DescriptionFunc(basicInformation.AcquisitionLevel);
            afterMoneyText.text        = LobbyManager.Instance.CurrentPlayer.Money.ToString();

            afterSkillPanel.GetComponentInChildren <Image>().color = new Color(0, 0, 0, 0.7f);
            afterSkillPanel.GetComponentInChildren <Text>().text   = "강화 완료";

            upgradeButton.gameObject.SetActive(false);
        }
        else
        {
            afterTitlePair.SetText(string.Format("{0} (Lv. {1})", basicInformation.Name, basicInformation.AcquisitionLevel + 1));
            afterSkillDescription.text = basicInformation.DescriptionFunc(basicInformation.AcquisitionLevel + 1);
            afterMoneyText.text        = (LobbyManager.Instance.CurrentPlayer.Money - basicInformation.RequiredUpgradeCost).ToString();

            afterSkillPanel.GetComponentInChildren <Image>().color = new Color(0, 0, 0, 0);
            afterSkillPanel.GetComponentInChildren <Text>().text   = string.Empty;

            upgradeButton.gameObject.SetActive(true);
        }
    }
    private GameObject CreateSkillCell(Transform parentTransform, SkillBasicInformation information)
    {
        var createdCell = Instantiate(skillCellTemplate, parentTransform);

        if (information.LearnEnabled == false)
        {
            var textComponent   = createdCell.GetComponentInChildren <Text>();
            var buttonComponent = createdCell.GetComponentInChildren <Button>();
            var imageComponent  = createdCell.GetComponentInChildren <Image>();

            textComponent.color = Color.magenta;
            textComponent.text  = "Locked";

            buttonComponent.interactable = false;

            imageComponent.color = new Color(0, 0, 0, 1f);
        }
        else
        {
            createdCell.GetComponentInChildren <Text>().text = string.Format("{0} ({1} / {2})", information.Name, information.AcquisitionLevel, information.MaximumLevel);
        }

        return(createdCell);
    }