コード例 #1
0
    public void SetBlockLevel(int _id, ParseAll.WhatBlockParse _wbp)
    {
        if (_wbp == ParseAll.WhatBlockParse.Builings || _wbp == ParseAll.WhatBlockParse.Technology)
        {
            foreach (var mm in MainResourcesController.buildingsLevel)
            {
                foreach (var nn in MainResourcesController.resDictionary)
                {
                    if (nn.resId == _id)
                        if (nn.resTechName == mm.Key)
                        {
                            blockLevel = mm.Value;
                        }
                }
            }
        }

        if (_wbp == ParseAll.WhatBlockParse.Research || _wbp == ParseAll.WhatBlockParse.Technology)
        {
            foreach (var mm in MainResourcesController.technologyLevel)
            {
                foreach (var nn in MainResourcesController.resDictionary)
                {
                    if (nn.resId == _id)
                        if (nn.resTechName == mm.Key)
                        {
                            blockLevel = mm.Value;
                        }
                }
            }
        }
    }
コード例 #2
0
    public void SetRequairments(string _xmlDoc, ParseAll.WhatBlockParse _wbp)
    {
        GetRequeriments(blockId, _xmlDoc);

        foreach (var mm in rList)
        {
            foreach (var nn in MainResourcesController.buildingsLevel)
            {
                if (nn.Key == mm.strTech)
                {
                    if (nn.Value >= mm.count_need)
                    {
                        reqText += "<color=#70B920>" + mm.strGood + " (" + mm.count_need + "),</color> ";
                        requairmentsText.text = reqText;
                    }
                    else
                    {
                        reqText += "<color=#E91C4E>" + mm.strGood + " (" + mm.count_need + "),</color> ";
                        requairmentsText.text = reqText;
                    }
                }
            }

            foreach (var pp in MainResourcesController.technologyLevel)
            {
                if (pp.Key == mm.strTech)
                {
                    if (pp.Value >= mm.count_need)
                    {
                        reqText += "<color=#70B920>" + mm.strGood + " (" + mm.count_need + "),</color> ";
                        requairmentsText.text = reqText;
                    }
                    else
                    {
                        reqText += "<color=#E91C4E>" + mm.strGood + " (" + mm.count_need + "),</color> ";
                        requairmentsText.text = reqText;
                    }
                }
            }

            if (_wbp == ParseAll.WhatBlockParse.Technology)
            {
                gameObject.SetActive(true);
            }
            else
            {
                if (reqText.Contains("E91C4E"))
                    gameObject.SetActive(false);
                else
                    gameObject.SetActive(true);
            }
        }
    }