Ejemplo n.º 1
0
        private bool WinLose()
        {
            if (status == "win")
            {
                WindowPanelBuilder w = WindowPanelBuilder.Create(S.T("endGameWin"));
                w.panel.AddLabel(S.T("endGamePoints", points, S.Round().Round));
                w.panel.AddButtonT("endgame", () => { SceneManager.LoadScene(0); });
                w.panel.AddButtonT("endGameWinButton", () => { });
                w.Finish();
                NAudio.PlayMusic("win", false);
                status = null;
                return(true);
            }

            if (status == "lose")
            {
                WindowPanelBuilder w = WindowPanelBuilder.Create(S.T("endGameLose"));
                w.panel.AddLabel(S.T("endGamePoints", points, S.Round().Round));
                w.panel.AddButtonT("endgame", () =>
                {
                    w.Close();
                });
                w.onClose = () =>
                {
                    S.Players().KillPlayer(id);
                };
                w.Finish();
                NAudio.PlayMusic("lose", false);
                status = null;
                return(true);
            }

            return(false);
        }
Ejemplo n.º 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());
        }