Beispiel #1
0
        public void SaveConfig(string name)
        {
            JsonSerializerOptions options = new JsonSerializerOptions
            {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
                WriteIndented        = true
            };
            GameInfo gameInfo = GetGameInfo(name, options);

            gameInfo.Version++;
            MoveToDir(@".\ToUpload\" + name, @Base.Config.Config().FolderApi + @"\" + name);
            gameInfo.RemoteGameInfo.Clear();

            /* for (int i = AllFolder.Count - 1; i > 0; i--)
             * {
             *   gameInfo.RemoteGameInfo.Add(AllFolder.ElementAt(i));
             * }*/
            foreach (FolderInfo info in AllFolder)
            {
                gameInfo.RemoteGameInfo.Add(info);
            }
            GameMeta     gameMeta     = GetGameMeta(options);
            GameMetaInfo gameMetaInfo = gameMeta.GetGameMeta(name);

            gameMetaInfo.Game = name;
            File.WriteAllText(@Base.Config.Config().FolderApi + @"\api.json", JsonSerializer.Serialize(gameMeta, options));
            File.WriteAllText(@Base.Config.Config().FolderApi + @"\" + name + ".json", JsonSerializer.Serialize(gameInfo, options));
            AllFolder.Clear();
            gameInfo.RemoteGameInfo.Clear();
        }
Beispiel #2
0
    public string EndGameDialog()
    {
        PlayerMeta player = BaseSaver.GetPlayer();
        GameMeta   game   = BaseSaver.GetGame();

        Unit.FactionType faction = player.faction;
        World            world   = player.world;

        string       returnStr         = "Congratulations! You have completed the campaign for faction: " + faction.ToString() + "!";
        List <World> unlockedWorldsLst = new List <World>(game.unlockedWorlds);

        if (world != World.candy)
        {
            List <Unit.FactionType> unlockedFactionLst = new List <Unit.FactionType>(game.unlockedFactions);
            switch (faction)
            {
            case Unit.FactionType.Human:
                if (!unlockedWorldsLst.Contains(World.mountain))
                {
                    unlockedWorldsLst.Add(World.mountain);
                    unlockedFactionLst.Add(Unit.FactionType.Egypt);
                    returnStr += "\n\n Unlocked faction: " + Unit.FactionType.Egypt.ToString() + "!";
                }
                break;

            case Unit.FactionType.Egypt:
                if (!unlockedWorldsLst.Contains(World.pyramid))
                {
                    unlockedWorldsLst.Add(World.pyramid);
                    unlockedFactionLst.Add(Unit.FactionType.Cthulhu);
                    returnStr += "\n\n Unlocked faction: " + Unit.FactionType.Cthulhu.ToString() + "!";
                }
                break;

            case Unit.FactionType.Cthulhu:
                if (!unlockedWorldsLst.Contains(World.candy))
                {
                    unlockedWorldsLst.Add(World.candy);
                    returnStr += "\n\n Unlocked world: " + World.candy.ToString() + "!";
                }
                break;
            }
            game.unlockedFactions = unlockedFactionLst.ToArray();
            game.unlockedWorlds   = unlockedWorldsLst.ToArray();
        }
        else
        {
            if (!unlockedWorldsLst.Contains(World.final))
            {
                unlockedWorldsLst.Add(World.final);
            }
            returnStr += "\n\n The world has been saved! Your accomplishments have been logged in the annals history.";
        }
        BaseSaver.PutGame(game);
        HighScoreMeta.SaveCurrentScore();

        //Reset the current save now that the factions / worlds have been unlocked and highscores saved
        BaseSaver.ResetAtSave();
        return(returnStr);
    }
Beispiel #3
0
    void Awake()
    {
        selected = "";
        PlayerMeta player = BaseSaver.GetPlayer();

        BoardMeta[] boards = BaseSaver.GetBoards();
        destSave = new List <string>(player.stats.dests);
        if (boards == null)
        {
            //SceneManager.LoadScene("ScrollingTextScene");
            Dictionary <string, BoardMeta> bMet = MapStatic.ReturnTestBoardDests(player.world == GameMeta.World.tutorial);
            List <BoardMeta> bList = new List <BoardMeta>();
            foreach (string key in bMet.Keys)
            {
                bList.Add(bMet[key]);
            }
            BaseSaver.PutBoards(bList.ToArray());
        }
        if (GameMeta.GameEnded())
        {
            SceneManager.LoadScene("ScrollingTextScene");
        }
        else if (GameMeta.RosterNeedsUpgrade())
        {
            SceneManager.LoadScene("TechScene");
        }

        ChangeDests(w0Dests, false);
        ChangeDests(w1Dests, false);
        ChangeDests(w2Dests, false);
        ChangeDests(w3Dests, false);
        ChangeDests(w4Dests, false);
        descPnl.SetActive(false);

        float time = player.stats.dests.Length == 1 ? 2 : .8f;

        switch (player.world)
        {
        case GameMeta.World.mountain:
            StartCoroutine(ZoomScale(new Vector3(850, -175, 0), w2Dests, time));
            break;

        case GameMeta.World.pyramid:
            StartCoroutine(ZoomScale(new Vector3(-600, -175, 0), w3Dests, time));
            break;

        case GameMeta.World.candy:
            StartCoroutine(ZoomScale(new Vector3(-600, 225, 0), w4Dests, time));
            break;

        case GameMeta.World.tutorial:
            StartCoroutine(ZoomScale(new Vector3(850, 225, 0), w0Dests, time));
            break;

        default:
            StartCoroutine(ZoomScale(new Vector3(850, 225, 0), w1Dests, time));
            break;
        }
    }
Beispiel #4
0
    /*
     * Save Game
     */
    public static void PutGame(GameMeta game)
    {
        string json = JsonUtility.ToJson(game);

        PlayerPrefs.SetString(GAME, json);

        Debug.Log("GAME set: " + GAME + ":" + json);
    }
Beispiel #5
0
    void PopulateClassesPanel()
    {
        classPnl.SetActive(true);
        classBtn.GetComponent <Outline>().effectColor = Color.red;
        GameMeta game      = BaseSaver.GetGame();
        string   pnlString = "";

        classPnl.transform.GetChild(1).GetChild(0).GetChild(0).GetComponent <TextMeshProUGUI>().text = pnlString;
        classPnl.transform.GetChild(1).GetChild(1).GetChild(0).GetComponent <Animator>().runtimeAnimatorController = null;
        classPnl.transform.GetChild(1).GetChild(1).GetChild(0).GetComponent <ImageAnimation>().Flush();
        classPnl.transform.GetChild(1).GetChild(2).GetComponent <TextMeshProUGUI>().text = pnlString;
        classPnl.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().text = pnlString;

        string[] clssSeen = game.classesSeen.Where(clss => !(clss.Contains("BaseMage") || clss.Contains("BaseScout") || clss.Contains("BaseSoldier"))).ToArray();

        if (clssSeen.Length > 0)
        {
            game.classesSeen = game.classesSeen.OrderBy(nm => nm).ToArray();

            classPnl.transform.GetChild(0).GetChild(0).GetComponent <RectTransform>().sizeDelta = new Vector2(800, 150 * game.classesSeen.Length);

            foreach (Transform child in classPnl.transform.GetChild(0).GetChild(0))
            {
                Destroy(child.gameObject);
            }

            //string[] clssSeen = game.classesSeen.Where(clss => !(clss.Contains("BaseMage") || clss.Contains("BaseScout") || clss.Contains("BaseSoldier"))).ToArray();

            for (int i = 0; i < clssSeen.Length; i++)
            {
                //foreach(string clss in game.classesSeen.Where(clss => !(clss.Contains("BaseMage") || clss.Contains("BaseScout") || clss.Contains("BaseSoldier"))).ToArray()){
                string     clss    = clssSeen[i];
                GameObject clssCpy = Instantiate(clssRw, classPnl.transform.GetChild(0).GetChild(0));
                clssCpy.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = ClassNode.FormatClass(clss);
                ClassNode nde      = StaticClassRef.GetClass((StaticClassRef.AvailableClasses)Enum.Parse(typeof(StaticClassRef.AvailableClasses), clss));
                UnitProxy baseUnit = ClassNode.ComputeClassBaseUnit(nde, glossy);
                clssCpy.transform.GetChild(1).GetComponent <Image>().sprite         = baseUnit.transform.GetChild(0).GetComponent <SpriteRenderer>().sprite;
                clssCpy.transform.GetChild(2).GetComponent <TextMeshProUGUI>().text = " " + ClassNode.GetFactionFromClass(clss);
                clssCpy.GetComponent <Button>().onClick.AddListener(() => {
                    instance.SetClassInfoText("Battle Bonus: " + StaticClassRef.GetFullClassDescription(clss) + "\n\nInactive Bonus: " + nde.ClassInactiveDesc(), StaticClassRef.GetClassByReference(clss).ClassName(),
                                              ClassNode.GetClassHeirarchyString(nde));
                    instance.SetClassSpriteAnimator(baseUnit.transform.GetChild(0).GetComponent <Animator>());
                });
                if (i == 0)
                {
                    clssCpy.GetComponent <Button>().onClick.Invoke();
                }
            }
            classPnl.transform.GetChild(0).GetComponent <ScrollRect>().normalizedPosition = new Vector2(0, 1);
        }
        else
        {
            SetClassInfoText("", "", "No classes found yet... Explore a little bit more and maybe something will be here!");
        }
    }
Beispiel #6
0
    public static void Save()
    {
        GameMeta gameMeta = Director.Instance.GameMeta;

        PlayerPrefs.SetString("nickname", gameMeta.PlayerName);
        PlayerPrefs.SetInt("defaultCursor", gameMeta.DefaultCursor ? 0 : 1);
        PlayerPrefs.SetInt("customColor", gameMeta.CustomColor ? 1 : 0);
        PlayerPrefs.SetInt("colorID", (int)gameMeta.ColorID);
        PlayerPrefs.SetInt("r", gameMeta.R);
        PlayerPrefs.SetInt("g", gameMeta.G);
        PlayerPrefs.SetInt("b", gameMeta.B);
    }
Beispiel #7
0
    // Update is called once per frame
    public void Click(string faction)
    {
        Debug.Log("Click: " + faction);
        string     aiStr  = "\nCampaign: Easy\n";
        GameMeta   game   = BaseSaver.GetGame();
        PlayerMeta player = BaseSaver.GetPlayer();

        player.faction = (Unit.FactionType)Enum.Parse(typeof(Unit.FactionType), faction);

        Color mainColor = HelperScripts.GetColorByFaction(player.faction);

        mainColor.a = .5f;
        GetComponent <Image>().color = mainColor;
        //transform.GetChild(2).GetComponent<Image>().color = HelperScripts.GetColorByFactionBold(player.faction);

        ResetParticles();

        if (finalWorld)
        {
            player.world = GameMeta.World.candy;
            aiStr        = "\nCampaign: Hard\n";
        }
        else
        {
            switch (player.faction)
            {
            case Unit.FactionType.Human: player.world = GameMeta.World.nile; break;

            case Unit.FactionType.Egypt: player.world = GameMeta.World.mountain; break;

            case Unit.FactionType.Cthulhu: player.world = GameMeta.World.pyramid; aiStr = "\nCampaign: Hard\n"; break;

            default: player.world = GameMeta.World.nile; break;
            }
        }

        switch (player.faction)
        {
        case Unit.FactionType.Human: SetParticles(human, true); break;

        case Unit.FactionType.Egypt: SetParticles(egypt, true); break;

        case Unit.FactionType.Cthulhu: SetParticles(cthulhu, true); break;
        }

        BaseSaver.PutPlayer(player);
        desc.text = "- " + faction + " - " + aiStr + "Strategy: " + Unit.GetFactionDesc(player.faction);
        btn.SetActive(true);
    }
Beispiel #8
0
        private GameMeta GetGameMeta(JsonSerializerOptions options)
        {
            GameMeta gameMeta;

            if (File.Exists(@Base.Config.Config().FolderApi + @"\api.json"))
            {
                gameMeta = JsonSerializer.Deserialize <GameMeta>(File.ReadAllText(@Base.Config.Config().FolderApi + @"\api.json"), options);
                File.Delete(@Base.Config.Config().FolderApi + @"\api.json");
            }
            else
            {
                gameMeta = new GameMeta();
            }
            return(gameMeta);
        }
Beispiel #9
0
    // Start is called before the first frame update
    void Awake()
    {
        btn.SetActive(false);
        finale.SetActive(false);
        desc.text = "";

        human.SetActive(true);
        egypt.SetActive(true);
        cthulhu.SetActive(true);

        GameMeta game = BaseSaver.GetGame();
        List <Unit.FactionType> factions = new List <Unit.FactionType>(game.unlockedFactions);

        //if (factions.Contains(Unit.FactionType.Human)) {
        //    human.SetActive(true);
        //}
        if (factions.Contains(Unit.FactionType.Egypt))
        {
            //foreach(Transform child in egypt.transform){
            //    if (child.name.Equals("lock")) {
            //        child.gameObject.SetActive(false);
            //    }
            //}
            //egypt.SetActive(true);
            egypt.transform.GetChild(1).gameObject.SetActive(false);
        }
        else
        {
            egypt.GetComponent <Button>().enabled = false;
        }
        if (factions.Contains(Unit.FactionType.Cthulhu))
        {
            //cthulhu.SetActive(true);
            cthulhu.transform.GetChild(1).gameObject.SetActive(false);
        }
        else
        {
            cthulhu.GetComponent <Button>().enabled = false;
        }
        if (factions.Contains(Unit.FactionType.Human) && factions.Contains(Unit.FactionType.Egypt) && factions.Contains(Unit.FactionType.Cthulhu))
        {
            finale.SetActive(true);
            SetFinaleColors();
        }

        finale.transform.GetChild(0).gameObject.SetActive(false);
        ResetParticles();
    }
Beispiel #10
0
    void PopulateSkillsPanel()
    {
        skillPnl.SetActive(true);
        skillBtn.GetComponent <Outline>().effectColor = Color.red;
        GameMeta game      = BaseSaver.GetGame();
        string   pnlString = "";

        skillPnl.transform.GetChild(1).GetChild(0).GetChild(0).GetComponent <TextMeshProUGUI>().text = pnlString;
        skillPnl.transform.GetChild(1).GetChild(1).GetChild(0).GetComponent <Animator>().runtimeAnimatorController = null;
        skillPnl.transform.GetChild(1).GetChild(1).GetChild(0).GetComponent <ImageAnimation>().Flush();
        skillPnl.transform.GetChild(1).GetChild(2).GetComponent <TextMeshProUGUI>().text = pnlString;
        skillPnl.transform.GetChild(1).GetChild(3).GetComponent <TextMeshProUGUI>().text = pnlString;

        if (game.skillsSeen.Length > 0)
        {
            game.skillsSeen = game.skillsSeen.OrderBy(nm => nm).ToArray();
            skillPnl.transform.GetChild(0).GetChild(0).GetComponent <RectTransform>().sizeDelta = new Vector2(800, 220 * game.skillsSeen.Length);

            foreach (Transform child in skillPnl.transform.GetChild(0).GetChild(0))
            {
                Destroy(child.gameObject);
            }

            for (int i = 0; i < game.skillsSeen.Length; i++)
            {
                //foreach(string skll in game.skillsSeen){
                string     skll    = game.skillsSeen[i];
                GameObject skllCpy = Instantiate(skillRw, skillPnl.transform.GetChild(0).GetChild(0));
                skllCpy.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = skll;
                Skill tSkill = Skill.ReturnSkillByString((Skill.SkillClasses)Enum.Parse(typeof(Skill.SkillClasses), skll));
                skllCpy.GetComponent <Button>().onClick.AddListener(() => {
                    instance.SetSkillInfoText(tSkill.PrintDetails() + " " + tSkill.PrintStackDetails() + "\n", skll, "");
                    instance.SetSkillSpriteAnimator(tSkill.GetSkillGen());
                });
                if (i == 0)
                {
                    skllCpy.GetComponent <Button>().onClick.Invoke();
                }
            }
            skillPnl.transform.GetChild(0).GetComponent <ScrollRect>().normalizedPosition = new Vector2(0, 1);
        }
        else
        {
            SetSkillInfoText("", "", "No skills found yet... Explore a little bit more and maybe something will be here!");
        }
    }
Beispiel #11
0
    public static void SaveCurrentScore()
    {
        GameMeta   game   = BaseSaver.GetGame();
        PlayerMeta player = BaseSaver.GetPlayer();

        List <HighScoreMeta> hScores   = new List <HighScoreMeta>(game.scores);
        HighScoreMeta        thisScore = new HighScoreMeta();

        thisScore.score   = player.characters.Sum(pChar => pChar.GetLvl());
        thisScore.faction = player.faction;
        thisScore.world   = player.world;
        thisScore.name    = "tom";
        hScores.Add(thisScore);
        game.scores = hScores.ToArray();

        BaseSaver.PutGame(game);
    }
Beispiel #12
0
    void Refresh()
    {
        PrintSave("sv1", save1);
        PrintSave("sv2", save2);
        PrintSave("sv3", save3);

        GameMeta game = BaseSaver.GetGame();

        if (game == null)
        {
            Debug.Log("Game is null");
            BaseSaver.PutGame(new GameMeta());
        }
        else
        {
            Debug.Log("Game is not null");
        }
    }
Beispiel #13
0
        private void startGame()
        {
            // these are different for clients
            var commandDispatcher = new ServerCommandDispatcher(new DefaultCommandExecutor());
            var requestDispatcher = new ServerRequestDispatcher(commandDispatcher);
            var dispatcher        = new ServerDispatcher(commandDispatcher);

            var meta = new GameMeta(logger, dispatcher);

            var gameState    = GameStateBuilder.Generate(meta, new DefaultTilemapGenerator(logger));
            var gameInstance = new GameInstance(
                gameState,
                new GameCamera(inputManager, meta, gameState.Level.Tilemap.Radius),
                requestDispatcher
                );

            Parent.AddScreenLayerOnTopOf(this, new GameUI(Parent, Geometries, gameInstance, inputManager));
            gameStarted = true;
            Destroy();
        }
Beispiel #14
0
            public async Task <Unit> Handle(CreateNewGameCommand request, CancellationToken cancellationToken)
            {
                var random   = new Random();
                var gameMeta = new GameMeta()
                {
                    Id          = Guid.NewGuid(),
                    UserName    = request.UserName,
                    Session     = Guid.NewGuid().ToString(),
                    Incrementor = 2,
                    Width       = Consts.MapWidth,
                    Height      = Consts.MapHeight,
                    Turn        = 0,
                    GameState   = GameState.Pending,
                    PlayerScene = Consts.InitialSceneId,
                    StartDate   = DateTime.Now,
                    LastDate    = DateTime.Now,
                    PlayerActor = new Actor()
                    {
                        Id       = 1,
                        X        = Consts.PlayerInitialX,
                        Y        = Consts.PlayerInitialY,
                        Name     = request.PlayerName,
                        NativeId = Consts.PlayerNativeId
                    }
                };

                _gameContext.GameMeta.InsertOne(gameMeta);
                var sceneSegment = await _mediator.Send(new GenerateNewSegmentCommand()
                {
                    GameId  = gameMeta.Id,
                    SceneId = Consts.InitialSceneId,
                    Seed    = random.Next()
                });

                _gameContext.SceneSegments.InsertOne(sceneSegment);
                await _gameContext.ApplyChangesAsync(cancellationToken);

                return(Unit.Value);
            }
Beispiel #15
0
    /*
     * Save Player
     */
    public static void PutPlayer(PlayerMeta player)
    {
        /*
         * Here is where the classes and skills need to be looked at to
         * see if the player has seen anything new
         */
        GameMeta game = BaseSaver.GetGame();

        if (game != null)
        {
            List <string> classesSeen = new List <string>(game.classesSeen);
            List <string> skillsSeen  = new List <string>(game.skillsSeen);
            foreach (Unit unt in player.characters)
            {
                if (!classesSeen.Contains(unt.GetCurrentClassString()))
                {
                    classesSeen.Add(unt.GetCurrentClassString());
                }
                foreach (string skill in unt.GetSkills())
                {
                    if (!skillsSeen.Contains(skill))
                    {
                        skillsSeen.Add(skill);
                    }
                }
            }
            game.classesSeen = classesSeen.ToArray();
            game.skillsSeen  = skillsSeen.ToArray();
            PutGame(game);
        }

        string json = JsonUtility.ToJson(player);

        PlayerPrefs.SetString(AdjKy(PLAYER), json);

        Debug.Log("PLAYER set: " + AdjKy(PLAYER) + ":" + json);
    }
Beispiel #16
0
    public void RefreshSelect()
    {
        if (GameMeta.RosterNeedsUpgrade())
        {
            buttonImg.color = new Color(1, .35f, .35f);
        }
        else
        {
            buttonImg.color = Color.white;
        }
        foreach (Transform child in chrSelect.transform)
        {
            Destroy(child.gameObject);
        }
        player = BaseSaver.GetPlayer();
        List <Unit> units = new List <Unit>(player.characters.Reverse());

        for (int i = 0; i < units.Count; i++)
        {
            PopulateRw(units[i], i);
        }
        if (units.Count > 3)
        {
            inactive.SetActive(true);
            List <Unit> inact = new List <Unit>();
            for (int i = 3; i < units.Count; i++)
            {
                inact.Add(units[i]);
            }
            inactive.transform.GetChild(0).GetComponent <TextMeshProUGUI>().text = ClassNode.GetClassBonusString(inact.ToArray());
        }
        else
        {
            inactive.SetActive(false);
        }
    }
Beispiel #17
0
 public DownloaderMain(Form1 bas)
 {
     Base        = bas;
     AllGameMeta = GetGamesMeta();
 }
Beispiel #18
0
    //private float percentsPerSecond = 0.2f;
    //private float sceneProgress = 0;

    void Awake()
    {
        GameMeta   game   = BaseSaver.GetGame();
        PlayerMeta player = BaseSaver.GetPlayer();

        waiting   = false;
        candleIdx = 0;
        lightIdx  = 0;
        //lightNUM = SwitchLights();
        //candleNUM = SwitchCandles();
        cutsceneSnapshot = FMODUnity.RuntimeManager.CreateInstance(FMODPaths.CutsceneSnapshot);
        musicIntro       = FMODUnity.RuntimeManager.CreateInstance(FMODPaths.MusicIntroEvent);

        StartCoroutine(SwitchLights());
        StartCoroutine(SwitchCandles());
        textHolder = new string[] { };
        gameEnded  = GameMeta.GameEnded();
        if (!gameEnded)
        {
            List <string> txts = new List <string>();
            if (!game.intro)
            {
                txts       = new List <string>(StoryStatic.INTRO_STRING);
                game.intro = true;
                BaseSaver.PutGame(game);
            }
            switch (player.faction)
            {
            case Unit.FactionType.Cthulhu: txts.Add(StoryStatic.CTHULHU_INTRO); break;

            case Unit.FactionType.Egypt: txts.Add(StoryStatic.EGYPT_INTRO); break;

            case Unit.FactionType.Human: txts.Add(StoryStatic.HUMAN_INTRO); break;
            }
            textHolder = txts.ToArray();
        }
        else
        {
            backgrounds.SetActive(false);
            if (player.world == GameMeta.World.tutorial)
            {
                textHolder = new string[] { "Congratulations! Tutorial completed. Good luck with the main story!" };
            }
            else
            {
                textHolder = new string[] { game.EndGameDialog() };
                if (player.world == GameMeta.World.candy)
                {
                    switch (player.faction)
                    {
                    case Unit.FactionType.Cthulhu: textHolder = new string[] { StoryStatic.CTHULHU_WIN }; break;

                    case Unit.FactionType.Egypt: textHolder = new string[] { StoryStatic.EGYPT_WIN }; break;

                    case Unit.FactionType.Human: textHolder = new string[] { StoryStatic.HUMAN_WIN }; break;
                    }
                }
            }
        }
        clickToContinue.SetActive(false);
    }
Beispiel #19
0
    void PopulateHScoresPanel()
    {
        hScorePnl.SetActive(true);
        hScoreBtn.GetComponent <Outline>().effectColor = Color.red;

        camp1.transform.GetChild(1).gameObject.SetActive(false);
        camp2.transform.GetChild(1).gameObject.SetActive(false);
        camp3.transform.GetChild(1).gameObject.SetActive(false);
        camp4.transform.GetChild(1).gameObject.SetActive(false);

        GameMeta game = BaseSaver.GetGame();

        foreach (GameMeta.World world in game.unlockedWorlds)
        {
            switch (world)
            {
            case GameMeta.World.mountain:
                camp1.transform.GetChild(1).gameObject.SetActive(true);
                camp1.transform.GetChild(0).gameObject.SetActive(false);
                camp1.GetComponent <Image>().enabled = false;
                break;

            case GameMeta.World.pyramid:
                camp2.transform.GetChild(1).gameObject.SetActive(true);
                camp2.transform.GetChild(0).gameObject.SetActive(false);
                camp2.GetComponent <Image>().enabled = false;
                break;

            case GameMeta.World.candy:
                camp3.transform.GetChild(1).gameObject.SetActive(true);
                camp3.transform.GetChild(0).gameObject.SetActive(false);
                camp3.GetComponent <Image>().enabled = false;
                break;

            case GameMeta.World.final:
                camp4.transform.GetChild(1).gameObject.SetActive(true);
                camp4.transform.GetChild(0).gameObject.SetActive(false);
                camp4.GetComponent <Image>().enabled = false;
                break;
            }
        }
        string pnlString = "High Scores:\n\n";
        //if (game.scores.Length > 0) {
        List <HighScoreMeta> scores    = new List <HighScoreMeta>(game.scores);
        List <HighScoreMeta> camp1scrs = scores.Where(scr => scr.world == GameMeta.World.nile).ToList();
        List <HighScoreMeta> camp2scrs = scores.Where(scr => scr.world == GameMeta.World.mountain).ToList();
        List <HighScoreMeta> camp3scrs = scores.Where(scr => scr.world == GameMeta.World.pyramid).ToList();
        List <HighScoreMeta> camp4scrs = scores.Where(scr => scr.world == GameMeta.World.candy).ToList();

        camp1scrs.OrderBy(scr => scr.score);
        camp2scrs.OrderBy(scr => scr.score);
        camp3scrs.OrderBy(scr => scr.score);
        camp4scrs.OrderBy(scr => scr.score);

        pnlString += (" Campaign 1 => " + (camp1scrs.Count > 0 ? camp1scrs[0].score.ToString() : "0") + "\n");
        pnlString += (" Campaign 2 => " + (camp2scrs.Count > 0 ? camp2scrs[0].score.ToString() : "0") + "\n");
        pnlString += (" Campaign 3 => " + (camp3scrs.Count > 0 ? camp3scrs[0].score.ToString() : "0") + "\n");
        pnlString += (" Campaign 4 => " + (camp4scrs.Count > 0 ? camp4scrs[0].score.ToString() : "0") + "\n");

        //foreach(HighScoreMeta scr in scores.Take(10)){
        //    pnlString += scr.ToString() + "\n";
        //}
        //}
        hScorePnl.transform.GetChild(0).GetChild(0).GetComponent <TextMeshProUGUI>().text = pnlString;
    }