Beispiel #1
0
        IEnumerator BeginNewGame()
        {
            yield return(load.ShowMessage("Loading"));

            if (LSys.tem == null)
            {
                yield return(LSys.Init(load));
            }
            else
            {
                LSys.tem.Load = load;
            }
            //Loading data
            yield return(L.Init());

            data           = new GameData();
            data.players   = new PlayerMgmt();
            data.towns     = new TownMgmt();
            data.buildings = new List <BuildingUnitData>();
            data.units     = new List <BuildingUnitData>();
            data.features  = new Dictionary <string, string>();
            data.map       = new GameMapData();
            data.modi      = new Dictionary <string, string>();

            //show it
            ConnectGameObjs();
            OptionHelper.RunStartOptions();
            data.players.Init();

            if (startConfig == null)
            {
                startConfig             = new Dictionary <string, string>();
                startConfig["name"]     = "debug";
                startConfig["type"]     = "scenario";
                startConfig["scenario"] = "tutorial3";
                //startConfig["scenario"] = "screenshot";
                startConfig["scenario"] = "debug";
            }

            yield return(load.ShowMessage("Loading " + startConfig["name"]));

            if (startConfig["type"] == "endless")
            {
                yield return(StartScenario("endless", startConfig["map"]));
            }
            else
            {
                yield return(StartScenario(startConfig["scenario"], LSys.tem.scenarios[startConfig["scenario"]].map));
            }
        }
Beispiel #2
0
        IEnumerator Start2()
        {
            NAudio.PlayMusic("title", true);
            //load database
            yield return(LSys.Init(GameObject.Find("UICanvas").GetComponentInChildren <LoadingScreen>(true)));

            yield return(L.Init());

            yield return(LSys.tem.Load.ShowMessage("Prepare main menu"));

            Debug.Log($"Start main menu V{Application.version}-{Application.platform}");

            version.text =
                $"{Application.productName} V{Application.version}-{Application.platform} - {Application.companyName}";
            warning.text = LSys.tem.helps["beta"].Desc().Replace(";;", Environment.NewLine);

            OptionHelper.RunStartOptions();

            L.b.gameButtons.BuildMenu(null, "title", null, true, panel.transform);

            //show it
            LSys.tem.Load.FinishLoading();


            // first start?
            if (!PlayerPrefs.HasKey("lastVersion"))
            {
                //todo dynamic
                if (Application.platform == RuntimePlatform.Android)
                {
                    new AndroidStartUp().Run();
                }
                else
                {
                    new ComputerStartUp().Run();
                }
            }

            //show message?
            if (PlayerPrefs.GetString("lastVersion", "x") != Application.version)
            {
                PlayerPrefs.SetString("lastVersion", Application.version);
                PlayerPrefs.Save();

                WindowPanelBuilder w = WindowPanelBuilder.Create("Good to know");

                foreach (var help in LSys.tem.helps.GetAllByCategory("start"))
                {
                    if (!help.req.Check(null))
                    {
                        continue;
                    }

                    w.panel.AddHeaderLabel(help.Name());
                    w.panel.RichText(help.Desc());
                }
                w.AddClose();
                w.Finish();
            }

            StartCoroutine(CheckUpdate());
        }