コード例 #1
0
    void OnTechClick(int id)
    {
        var tech = _techModel.techTree.getById(id);

        if (_techModel.techTree.isTechAvailable(tech))
        {
            CurrentTechRoot.SetActive(true);
            NoResearchObject.SetActive(false);
            _techModel.SetCurrentTech(tech);

            CurrentTechProgress.fillAmount = (float)tech.progress / (float)tech.baseCost;
            CurrentTechName.text           = string.Format("{0} {1:P0}", tech.techName, ((float)tech.progress / (float)tech.baseCost));
            CurrentTechDescription.text    = tech.descriptionString;

            string spriteID = "Banner_Tech_0" + id;
            this.CurrentTechIcon.sprite = spritePacker.FindSpriteByName(spriteID);
        }
    }