Beispiel #1
0
    public void LoadCorrectEggs()
    {
        // CHECK SCENE AND ASSIGN CORRECT EGGS FOUND
        if (SceneManager.GetActiveScene().name == "Market")
        {
            marketEggsFoundBools = MarketSaveLoadManager.LoadMarketEggs();

            marketSilverEggsCount = MarketSaveLoadManager.LoadMarketSilverEggs();

            rainbowRiddleSolved = MarketSaveLoadManager.LoadRainbowRiddle();


            List <bool> loadedEggs = MarketSaveLoadManager.LoadMarketEggs();

            if (loadedEggs.Count > 2)
            {
                marketEggsFoundBools = loadedEggs;
            }


            if (marketEggsFoundBools.Count < 1)
            {
                foreach (GameObject egg in clickOnEggsScript.eggs)
                {
                    Debug.Log("should be filling eggsfoundbool array");
                    marketEggsFoundBools.Add(egg.GetComponent <EggGoToCorner>().eggFound);
                }
            }
        }



        if (SceneManager.GetActiveScene().name == "Park")
        {
            parkEggsFoundBools = ParkSaveLoadManager.LoadParkEggs();

            parkSilverEggsCount = ParkSaveLoadManager.LoadParkSilverEggs();

            hopscotchRiddleSolved = ParkSaveLoadManager.LoadHopscotchRiddle();


            List <bool> loadedEggs = ParkSaveLoadManager.LoadParkEggs();

            if (loadedEggs.Count > 2)
            {
                parkEggsFoundBools = loadedEggs;
            }


            if (parkEggsFoundBools.Count < 1)
            {
                foreach (GameObject egg in clickOnEggsScript.eggs)
                {
                    Debug.Log("should be filling eggsfoundbool array");
                    parkEggsFoundBools.Add(egg.GetComponent <EggGoToCorner>().eggFound);
                }
            }
        }



        if (SceneManager.GetActiveScene().name == "Beach")
        {
            beachEggsFoundBools = BeachSaveLoadManager.LoadBeachEggs();

            beachSilverEggsCount = BeachSaveLoadManager.LoadBeachSilverEggs();

            crabRiddleSolved = BeachSaveLoadManager.LoadCrabRiddle();


            List <bool> loadedEggs = BeachSaveLoadManager.LoadBeachEggs();

            if (loadedEggs.Count > 2)
            {
                beachEggsFoundBools = loadedEggs;
            }


            if (beachEggsFoundBools.Count < 1)
            {
                foreach (GameObject egg in clickOnEggsScript.eggs)
                {
                    Debug.Log("should be filling eggsfoundbool array");
                    beachEggsFoundBools.Add(egg.GetComponent <EggGoToCorner>().eggFound);
                }
            }
        }
    }
    public void LoadCorrectEggs()
    {
        hubTotalEggsFound = 0;
        levelsCompleted   = GeneralSaveLoadManager.LoadLevelsCompleted();
        lastEggTotVal     = GeneralSaveLoadManager.LoadLastEggTotVal();
        fallLocked        = GeneralSaveLoadManager.LoadFallLocked();
        // CHECK SCENE AND ASSIGN CORRECT EGGS FOUND
        // Market
        if (SceneManager.GetActiveScene().name == marketName || SceneManager.GetActiveScene().name == marketPuzName || SceneManager.GetActiveScene().name == menuName)
        {
            riddleSolved      = false;
            eggsFoundBools    = MarketSaveLoadManager.LoadMarketEggs();
            eggsFoundOrder    = MarketSaveLoadManager.LoadMarketEggsOrder();
            silverEggsCount   = MarketSaveLoadManager.LoadMarketSilverEggs();
            riddleSolved      = MarketSaveLoadManager.LoadRainbowRiddle();
            totalEggsFound    = MarketSaveLoadManager.LoadMarketTotalEggs();
            puzzMaxLvl        = MarketSaveLoadManager.LoadMarketPuzzMaxLvl();
            puzzSilEggsCount  = MarketSaveLoadManager.LoadMarketPuzzSilEggsCount();
            sceneSilEggsCount = MarketSaveLoadManager.LoadMarketSceneSilEggsCount();
            levelComplete     = MarketSaveLoadManager.LoadMarketLevelComplete();
            birdIntroDone     = MarketSaveLoadManager.LoadMarketBirdIntro();
            puzzIntroDone     = MarketSaveLoadManager.LoadMarketPuzzIntro();
            List <bool> loadedEggs = MarketSaveLoadManager.LoadMarketEggs();
            if (loadedEggs.Count > 2)
            {
                eggsFoundBools = loadedEggs;
            }
            if (clickOnEggsScript != null && eggsFoundBools.Count < 1)
            {
                foreach (GameObject egg in clickOnEggsScript.eggs)
                {
                    eggsFoundBools.Add(egg.GetComponent <EggGoToCorner>().eggFound);
                    eggsFoundOrder.Add(0);
                }
            }

            ///camilo script to count eggs for the titles
            int eggsFoundAmmount = 0;
            if (silverEggsCount == 6)
            {
                marketSE = true;
            }
            if (riddleSolved)
            {
                marketGE = true;
            }
            for (int i = 0; i < eggsFoundBools.Count - 1; i++)
            {
                if (eggsFoundBools[i])
                {
                    eggsFoundAmmount++;
                }
            }
            if (eggsFoundAmmount == (eggsFoundBools.Count - 1) && eggsFoundAmmount > 0)
            {
                marketNE = true;
            }
            //end camiloScript

            hubTotalEggsFound += totalEggsFound;
        }
        // Park
        if (SceneManager.GetActiveScene().name == parkName || SceneManager.GetActiveScene().name == parkPuzName || SceneManager.GetActiveScene().name == menuName)
        {
            eggsFoundBools    = ParkSaveLoadManager.LoadParkEggs();
            eggsFoundOrder    = ParkSaveLoadManager.LoadParkEggsOrder();
            silverEggsCount   = ParkSaveLoadManager.LoadParkSilverEggs();
            riddleSolved      = ParkSaveLoadManager.LoadHopscotchRiddle();
            totalEggsFound    = ParkSaveLoadManager.LoadParkTotalEggs();
            puzzMaxLvl        = ParkSaveLoadManager.LoadParkPuzzMaxLvl();
            puzzSilEggsCount  = ParkSaveLoadManager.LoadParkPuzzSilEggsCount();
            sceneSilEggsCount = ParkSaveLoadManager.LoadParkSceneSilEggsCount();
            levelComplete     = ParkSaveLoadManager.LoadParkLevelComplete();
            birdIntroDone     = ParkSaveLoadManager.LoadParkBirdIntro();
            puzzIntroDone     = ParkSaveLoadManager.LoadParkPuzzIntro();

            List <bool> loadedEggs = ParkSaveLoadManager.LoadParkEggs();
            if (loadedEggs.Count > 2)
            {
                eggsFoundBools = loadedEggs;
            }

            if (clickOnEggsScript != null && eggsFoundBools.Count < 1)
            {
                foreach (GameObject egg in clickOnEggsScript.eggs)
                {
                    //Debug.Log("should be filling eggsFoundBool & eggsFoundOrder lists");
                    eggsFoundBools.Add(egg.GetComponent <EggGoToCorner>().eggFound);
                    eggsFoundOrder.Add(0);
                }
            }

            ///camilo script to count eggs for the titles
            int eggsFoundAmmount = 0;
            if (silverEggsCount == 6)
            {
                parkSE = true;
            }
            if (riddleSolved)
            {
                parkGE = true;
            }
            for (int i = 0; i < eggsFoundBools.Count - 1; i++)
            {
                if (eggsFoundBools[i])
                {
                    eggsFoundAmmount++;
                }
            }
            if (eggsFoundAmmount == (eggsFoundBools.Count - 1) && eggsFoundAmmount > 0)
            {
                parkNE = true;
            }
            //end camiloScript

            hubTotalEggsFound += totalEggsFound;
        }
        // Beach
        if (SceneManager.GetActiveScene().name == beachName || SceneManager.GetActiveScene().name == beachPuzName || SceneManager.GetActiveScene().name == menuName)
        {
            eggsFoundBools    = BeachSaveLoadManager.LoadBeachEggs();
            eggsFoundOrder    = BeachSaveLoadManager.LoadBeachEggsOrder();
            silverEggsCount   = BeachSaveLoadManager.LoadBeachSilverEggs();
            riddleSolved      = BeachSaveLoadManager.LoadCrabRiddle();
            totalEggsFound    = BeachSaveLoadManager.LoadBeachTotalEggs();
            puzzMaxLvl        = BeachSaveLoadManager.LoadBeachPuzzMaxLvl();
            puzzSilEggsCount  = BeachSaveLoadManager.LoadBeachPuzzSilEggsCount();
            sceneSilEggsCount = BeachSaveLoadManager.LoadBeachSceneSilEggsCount();
            levelComplete     = BeachSaveLoadManager.LoadBeachLevelComplete();
            birdIntroDone     = BeachSaveLoadManager.LoadBeachBirdIntro();
            puzzIntroDone     = BeachSaveLoadManager.LoadBeachPuzzIntro();

            List <bool> loadedEggs = BeachSaveLoadManager.LoadBeachEggs();
            if (loadedEggs.Count > 2)
            {
                eggsFoundBools = loadedEggs;
            }

            if (clickOnEggsScript != null && eggsFoundBools.Count < 1)
            {
                foreach (GameObject egg in clickOnEggsScript.eggs)
                {
                    // Debug.Log("should be filling eggsfoundbool array");
                    eggsFoundBools.Add(egg.GetComponent <EggGoToCorner>().eggFound);
                    eggsFoundOrder.Add(0);
                }
            }

            ///camilo script to count eggs for the titles
            int eggsFoundAmmount = 0;
            if (silverEggsCount == 6)
            {
                beachSE = true;
            }
            if (riddleSolved)
            {
                beachGE = true;
            }
            for (int i = 0; i < eggsFoundBools.Count - 1; i++)
            {
                if (eggsFoundBools[i])
                {
                    eggsFoundAmmount++;
                }
            }
            if (eggsFoundAmmount == (eggsFoundBools.Count - 1) && eggsFoundAmmount > 0)
            {
                beachNE = true;
            }
            //end camiloScript

            hubTotalEggsFound += totalEggsFound;
        }
    }