示例#1
0
    IEnumerator Start()
    {
        loading.SetActive(true);

        foreach (var mm in allLeftBtn)
        {
            mm.interactable = true;
        }

        pathToXml = Application.dataPath + "/config.xml";
        xmlDoc    = (TextAsset)Resources.Load("config");
        MainResourcesController mrc = TopBlock.GetComponent <MainResourcesController>();

        MainResourcesController.CreadeDictionaryBuildingsLevel();
        MainResourcesController.CreadeDictionaryResearchLevel();
        mrc.CreateDictionaryResources(xmlDoc.text);
        canBuild     = Root_build_conf.LoadFromText(xmlDoc.text);
        helpTextList = Root_helper_tech.LoadFromText(xmlDoc.text);
        XmlClass buidings = new XmlClass();

        foreach (var mm in canBuild.build_conf.allow_planet.canBuildList)
        {
            StartCoroutine(BuildingsInst(goInst, buidings, mm.canBuildId));
            StartCoroutine(TechInst(goInst, buidings, mm.canBuildId));
            yield return(null);
        }

        foreach (var mm in canBuild.build_conf.allow_planet.canResearchList)
        {
            StartCoroutine(ResearchInst(goInst, buidings, mm.canResearchId));
            StartCoroutine(TechInst(goInst, buidings, mm.canResearchId));
            yield return(null);
        }

        foreach (var mm in canBuild.build_conf.allow_planet.canFleetList)
        {
            StartCoroutine(DocInst(goInst, buidings, mm.canFleetId));
            StartCoroutine(TechInst(goInst, buidings, mm.canFleetId));
            yield return(null);
        }

        foreach (var mm in canBuild.build_conf.allow_planet.canDefenseList)
        {
            StartCoroutine(DefInst(goInst, buidings, mm.canDefenseId));
            StartCoroutine(TechInst(goInst, buidings, mm.canDefenseId));
            yield return(null);
        }

        ScreenManager scr = GameObject.Find("ScreenManager").GetComponent <ScreenManager>();

        scr.currentPanel = planetBlock;

        planetBlock.SetActive(true);
        loading.SetActive(false);
    }
示例#2
0
    void ParseTexts(int _id, int _whatParse)
    {
        switch (_whatParse)
        {
        case 0:
            helpBuild = Root_helper_buildings.LoadFromText(xmlDoc);
            foreach (var mm in helpBuild.helpBuildings)
            {
                if (_id == mm.helpBuildingsId)
                {
                    title = mm.helpBuildingsTitle;
                    desc  = mm.helpBuildingsDesc;
                }
            }
            break;

        case 1:
            helpResearch = Root_helper_research.LoadFromText(xmlDoc);
            foreach (var mm in helpResearch.helpResearch)
            {
                if (_id == mm.helpResearchId)
                {
                    title = mm.helpResearchTitle;
                    desc  = mm.helpResearchDesc;
                }
            }
            break;

        case 2:
            helpDoc = Root_helper_doc_def.LoadFromText(xmlDoc);
            foreach (var mm in helpDoc.helpDocs)
            {
                if (_id == mm.helpDocsId)
                {
                    title = mm.helpDocsTitle;
                    desc  = mm.helpDocsDesc;
                }
            }
            break;

        case 3:
            helpDef = Root_helper_def.LoadFromText(xmlDoc);
            foreach (var mm in helpDef.helpDef)
            {
                if (_id == mm.helpDefId)
                {
                    title = mm.helpDefTitle;
                    desc  = mm.helpDefDesc;
                }
            }
            break;

        case 4:
            helpTech = Root_helper_tech.LoadFromText(xmlDoc);
            foreach (var mm in helpTech.TechTreeItem)
            {
                if (_id == mm.TechTreeItemId)
                {
                    title = mm.TechTreeItemTitle;
                    desc  = mm.TechTreeItemDesc;
                }
            }
            break;
        }
    }