Exemplo n.º 1
0
 public static void Load()
 {
     PlayerManager.instance.player.transform.position = ES2.Load <Vector3>(folder + "Player.dat?tag=position");
     PlayerManager.instance.player.transform.rotation = ES2.Load <Quaternion>(folder + "Player.dat?tag=rotation");
     PlayerManager.instance.player.GetComponent <PlayerStats>().currentHealth = ES2.Load <int>(folder + "Player.dat?tag=health");
     AchievementData.instance.Achievements = ES2.LoadList <AchievementMeta>(folder + "Player.dat?tag=achievements");
 }
Exemplo n.º 2
0
    // If the events loader file exists, load the events with their names
    void LoadEvents()
    {
        if (ES2.Exists("eventGameObjects.txt?tag=eventTransforms" + SaveManager.currentProjID) && ES2.Exists("eventGameObjects.txt?tag=eventNames" + SaveManager.currentProjID))
        {
            List <Transform> eventTransforms = new List <Transform>();
            eventTransforms = ES2.LoadList <Transform>("eventGameObjects.txt?tag=eventTransforms" + SaveManager.currentProjID);

            List <string> eventTexts = new List <string>();
            eventTexts = ES2.LoadList <string>("eventGameObjects.txt?tag=eventNames" + SaveManager.currentProjID);

            for (int i = 0; i < eventTransforms.Count; i++)
            {
                // Apply the loaded positions of the events
                GameObject tempEvents = Instantiate(eventsPicture, eventTransforms[i].transform.position, Quaternion.identity) as GameObject;
                tempEvents.transform.SetParent(eventsParent.transform);
                AddAnEvent.events.Add(tempEvents);

                // Apply the loaded names of the events
                GameObject tempNames = Instantiate(nameObject, new Vector3(eventTransforms[i].transform.position.x, eventTransforms[i].transform.position.y + 0.1f, eventTransforms[i].transform.position.z), Quaternion.identity) as GameObject;
                tempNames.transform.SetParent(tempEvents.transform);
                tempNames.GetComponent <TextMesh>().text = eventTexts[i];
                tempNames.transform.localScale           = new Vector3(5f, 5f, 1f);
            }
        }
    }
Exemplo n.º 3
0
    // Load the project objects that will be used to open a saved project
    public void LoadProjectsIdsNNames()
    {
        if (ES2.Exists("projects.txt?tag=lastID" + currentProjID) && ES2.Exists("projects.txt?tag=ids" + currentProjID) && ES2.Exists("projects.txt?tag=projectNames" + currentProjID))
        {
            LoadManager.lastID = ES2.Load <int>("projects.txt?tag=lastID" + currentProjID);

            List <int>    ids          = new List <int>();
            List <string> projectNames = new List <string>();

            ids          = ES2.LoadList <int>("projects.txt?tag=ids" + currentProjID);
            projectNames = ES2.LoadList <string>("projects.txt?tag=projectNames" + currentProjID);

            for (int i = 0; i < ids.Count; i++)
            {
                GameObject tempProject = Instantiate(projectObject);
                tempProject.transform.SetParent(projectsParent.transform);
                tempProject.transform.localScale = new Vector3(1f, 1f, 1f);
                tempProject.GetComponent <LoadManager>().ownID = ids[i];
                tempProject.transform.FindChild("InputField").FindChild("Placeholder").GetComponent <Text>().text = projectNames[i];

                if (projectNames[i].Length == 0)
                {
                    tempProject.transform.FindChild("InputField").FindChild("Placeholder").GetComponent <Text>().text = "Empty Project";
                }
            }
        }
    }
Exemplo n.º 4
0
        public void LoadArrayList()
        {
            if (!isProxyValid())
            {
                return;
            }

            string _tag = uniqueTag.Value;

            if (string.IsNullOrEmpty(_tag))
            {
                _tag = Fsm.GameObjectName + "/" + Fsm.Name + "/arraylist/" + reference.Value;
            }

            ES2Settings loadSettings = new ES2Settings();

            if (loadFromResources.Value)
            {
                loadSettings.saveLocation = ES2Settings.SaveLocation.Resources;
            }

            List <string> source = ES2.LoadList <string>(saveFile.Value + "?tag=" + _tag);

            Log("Loaded from " + saveFile.Value + "?tag=" + uniqueTag);

            proxy.arrayList.Clear();

            foreach (string element in source)
            {
                proxy.arrayList.Add(PlayMakerUtils.ParseValueFromString(element));
            }

            Finish();
        }
Exemplo n.º 5
0
 public static void Load()
 {
     EasySaveLoadManager.Instance.savedScenes = ES2.LoadList <string>(folder + "Scenes.dat?tag=loadedScenes");
     foreach (string scene in ES2.LoadList <string>(folder + "Scenes.dat?tag=loadedScenes"))
     {
         Debug.Log("Saved " + scene);
     }
 }
Exemplo n.º 6
0
 void ReloadPickups()
 {
     if (!ES2.Exists("pickups"))
     {
         return;
     }
     pickupIndices = ES2.LoadList <int>("pickups");
     MapGeneration.instance.UpdatePickedUpPickups(pickupIndices);
 }
Exemplo n.º 7
0
    public List <int> LoadAnsweredQNumbers(string topicName)
    {
        List <int> answeredQNos = new List <int>();

        if (ES2.Exists("svt.txt?tag=answeredQNos" + topicName))
        {
            answeredQNos = ES2.LoadList <int>("svt.txt?tag=answeredQNos" + topicName);
        }

        return(answeredQNos);
    }
Exemplo n.º 8
0
        internal static void AddSaveFlag()
        {
            if (ES2.Exists(SavePath + "?tag=Bumper_RearTightness") && ES2.Exists(SavePath + "?tag=Bumper_RearBolts", setting))
            {
                MopSaveData save = new MopSaveData();
                save.rearBumperTightness = ES2.Load <float>(SavePath + "?tag=Bumper_RearTightness", setting);
                save.rearBumperBolts     = ES2.LoadList <string>(SavePath + "?tag=Bumper_RearBolts", setting);

                ModSave.Save(mopSavePath, save);
            }
        }
Exemplo n.º 9
0
    // Load the T and X lines with their names
    void LoadTXLines()
    {
        if (ES2.Exists("tLineGameObjects.txt?tag=tLineNames" + SaveManager.currentProjID) && ES2.Exists("xLineGameObjects.txt?tag=xLineNames" + SaveManager.currentProjID) && ES2.Exists("xLineGameObjects.txt?tag=xLineNames" + SaveManager.currentProjID) &&
            ES2.Exists("tLineGameObjects.txt?tag=tLineNameTransforms" + SaveManager.currentProjID) && ES2.Exists("xLineGameObjects.txt?tag=xLineNameTransforms" + SaveManager.currentProjID))
        {
            List <string> tLineTexts = new List <string>();
            tLineTexts = ES2.LoadList <string>("tLineGameObjects.txt?tag=tLineNames" + SaveManager.currentProjID);
            List <Transform> tNameTransforms = new List <Transform>();
            tNameTransforms = ES2.LoadList <Transform>("tLineGameObjects.txt?tag=tLineNameTransforms" + SaveManager.currentProjID);

            List <Transform> xLineTransforms = new List <Transform>();
            xLineTransforms = ES2.LoadList <Transform>("xLineGameObjects.txt?tag=xLineTransforms" + SaveManager.currentProjID);
            List <string> xLineTexts = new List <string>();
            xLineTexts = ES2.LoadList <string>("xLineGameObjects.txt?tag=xLineNames" + SaveManager.currentProjID);
            List <Transform> xNameTransforms = new List <Transform>();
            xNameTransforms = ES2.LoadList <Transform>("xLineGameObjects.txt?tag=xLineNameTransforms" + SaveManager.currentProjID);

            for (int i = 0; i < xLineTransforms.Count; i++)
            {
                GameObject txParent = new GameObject(); // Make a GameObject that will contain its T and X axis
                txParent.name = "txParent";

                // Apply T line Info
                float      xLineZRot = xLineTransforms[i].eulerAngles.z;
                GameObject tempTLine = Instantiate(tLineObject, xLineTransforms[i].position, Quaternion.Euler(0, 0, 90 - xLineZRot)) as GameObject;
                tempTLine.transform.parent     = txParent.transform;
                tempTLine.transform.localScale = xLineTransforms[i].transform.localScale;
                AddXandTAxis.linesT.Add(tempTLine);

                GameObject tempTLineNames = Instantiate(nameObject, tNameTransforms[i].position, Quaternion.identity) as GameObject;
                tempTLineNames.transform.SetParent(tempTLine.transform);
                tempTLineNames.GetComponent <TextMesh>().text = tLineTexts[i];
                tempTLineNames.transform.localScale           = tNameTransforms[i].localScale;
                tempTLineNames.transform.rotation             = tempTLine.transform.rotation;

                // Apply X Line Info

                GameObject tempXLine = Instantiate(xLineObject, xLineTransforms[i].position, xLineTransforms[i].rotation) as GameObject;
                tempXLine.transform.parent     = txParent.transform;
                tempXLine.transform.localScale = xLineTransforms[i].transform.localScale;
                AddXandTAxis.linesX.Add(tempXLine);

                GameObject tempXLineNames = Instantiate(nameObject, xNameTransforms[i].position, Quaternion.identity) as GameObject;
                tempXLineNames.transform.SetParent(tempXLine.transform);
                tempXLineNames.GetComponent <TextMesh>().text = xLineTexts[i];
                tempXLineNames.transform.localScale           = xNameTransforms[i].localScale;
                tempXLineNames.transform.rotation             = tempXLine.transform.rotation;

                txParent.transform.SetParent(txParentsParent.transform);
            }
        }
    }
Exemplo n.º 10
0
    public List <string> GetSaveList(string modelName)
    {
        if (ES2.Exists(Application.dataPath + "/save.txt?tag=" + modelName))
        {
            List <string> loadStringList = ES2.LoadList <string> (Application.dataPath + "/save.txt?tag=" + modelName);

            return(loadStringList);
        }
        else
        {
            return(null);
        }
    }
Exemplo n.º 11
0
    private void LoadEnemyKillStats()
    {
        _enemyKillStats = new List <EnemyKillStat>();

        if (ES2.Exists(_enemyKillStatsKey, _fileSettings))
        {
            _enemyKillStats = ES2.LoadList <EnemyKillStat>(_enemyKillStatsKey, _fileSettings);
        }

        //For a new session, we want to take the session kills and store them into last session
        _enemyKillStats.ForEach(ks => ks.KillsLastSession = ks.KillsThisSession);
        //then we want to start the kills for this session at 0.
        _enemyKillStats.ForEach(ks => ks.KillsThisSession = 0);
    }
Exemplo n.º 12
0
 public void LoadData()
 {
     itemTittles  = ES2.LoadList <string>(dataFile + "?tag=itemTittles");
     itemSprites  = ES2.LoadList <string>(dataFile + "?tag=itemSprites");
     itemNumsMax  = ES2.LoadList <int>(dataFile + "?tag=itemNumsMax");
     itemUnlockAt = ES2.LoadList <int>(dataFile + "?tag=itemUnlockAt");
     itemPrices   = ES2.LoadList <int>(dataFile + "?tag=itemPrices");
     graph_1      = ES2.LoadList <float>(dataFile + "?tag=graph_1");
     graph_2      = ES2.LoadList <float>(dataFile + "?tag=graph_2");
     graph_3      = ES2.LoadList <float>(dataFile + "?tag=graph_3");
     graph_4      = ES2.LoadList <float>(dataFile + "?tag=graph_4");
     graph_5      = ES2.LoadList <float>(dataFile + "?tag=graph_5");
     avility      = ES2.LoadList <string>(dataFile + "?tag=avility");
     colorRange   = ES2.LoadList <float>(dataFile + "?tag=colorRange");
     numbering    = new int[colorRange.Count];
 }
Exemplo n.º 13
0
    public void loadFromFile()
    {
        memories   = ES2.LoadList <MemoryObject>("merky.txt?tag=memories");
        gameStates = ES2.LoadList <GameState>("merky.txt?tag=states");
        //Scenes
        List <SceneLoader> rsls = ES2.LoadList <SceneLoader>("merky.txt?tag=scenes");

        foreach (SceneLoader sl in sceneLoaders) //actually loaded scene loaders
        {
            foreach (SceneLoader rsl in rsls)    //read in scene loaders
            {
                if (rsl != null && sl.sceneName == rsl.sceneName)
                {
                    sl.lastOpenGameStateId = rsl.lastOpenGameStateId;
                    Destroy(rsl);
                    break;
                }
            }
        }
    }
Exemplo n.º 14
0
    void Load()
    {
        if (!myGOD.loadGame)
        {
            return;
        }


        string loadPath = GOD_Memory.rootFolder + "god";

        //   UnityEngine.Debug.Log("load path= " + loadPath);
        if (!ES2.Exists(loadPath))
        {
            return;
        }
        loadPath += "?tag=" + "god";

        myGOD.currentSkulls = ES2.Load <int>(loadPath + "skullCurrency");

        myGOD.ownedLamina = ES2.LoadList <string>(loadPath + "ownedLamina");
    }
Exemplo n.º 15
0
    public void LoadPostit()
    {
        if (loaded)
        {
            return;
        }
        loaded = true;

        postitAmount = ES2.Load <int>("amount");

        positions = ES2.LoadList <Vector3>("positions");
        colors    = ES2.LoadList <string>("colors");

        titlesF = ES2.LoadList <string>("titlesF");

        //titlesR = ES2.LoadList<string>("titlesR");
        //titlesB = ES2.LoadList<string>("titlesB");
        //titlesL = ES2.LoadList<string>("titlesL");

        valuesR = ES2.LoadList <int>("valuesR");
        valuesB = ES2.LoadList <int>("valuesB");
        valuesL = ES2.LoadList <int>("valuesL");

        for (int i = 0; i < postitAmount; i++)
        {
            switch (colors[i])
            {
            case "Yellow":
                GameObject py = Instantiate(yellowCube, positions[i], Quaternion.identity);
                Attributes ay = py.GetComponent <Attributes>();

                ay.newNameF = titlesF[i];

                ay.valueR = valuesR[i];
                ay.valueB = valuesB[i];
                ay.valueL = valuesL[i];
                break;

            case "Pink":
                GameObject pp = Instantiate(pinkCube, positions[i], Quaternion.identity);
                Attributes ap = pp.GetComponent <Attributes>();

                ap.newNameF = titlesF[i];

                ap.valueR = valuesR[i];
                ap.valueB = valuesB[i];
                ap.valueL = valuesL[i];
                break;

            case "Blue":
                GameObject pb = Instantiate(blueCube, positions[i], Quaternion.identity);
                Attributes ab = pb.GetComponent <Attributes>();

                ab.newNameF = titlesF[i];

                ab.valueR = valuesR[i];
                ab.valueB = valuesB[i];
                ab.valueL = valuesL[i];
                break;

            case "Green":
                GameObject pg = Instantiate(greenCube, positions[i], Quaternion.identity);
                Attributes ag = pg.GetComponent <Attributes>();

                ag.newNameF = titlesF[i];

                ag.valueR = valuesR[i];
                ag.valueB = valuesB[i];
                ag.valueL = valuesL[i];
                break;
            }
        }
    }
Exemplo n.º 16
0
 public void loadFromFile()
 {
     memories   = ES2.LoadList <MemoryObject>("merky.txt?tag=memories");
     gameStates = ES2.LoadList <GameState>("merky.txt?tag=states");
 }
    void AffichageAutomatique()
    {
        //Affichage des suites
        if (ES2.Exists("count"))
        {
            //On charge le booléen correspondant à la scène (choisi ou non)
            LoadValueScenes();

            //Si on a enregistré le nombre de scène, on lance la boucle
            if (ES2.Exists("numScenes"))
            {
                //on enregistre le nombre de scène
                numScenes = ES2.LoadList <int>("numScenes");
                //on enregistre le nombre de scènes chargées
                int range = ES2.Load <int>("count");

                //on ne doit pas aller au delà du nombre de scène
                if (numScenes.Count - 1 >= range)
                {
                    //On lance l'affichage automatique en fonction des scènes déjà lancées
                    switch (ES2.Load <int>("count"))
                    {
                    case 1:
                        if (scene3)
                        {
                            if (scene4)
                            {
                                chemin1to2();
                            }
                            else if (scene5)
                            {
                                chemin1to3();
                            }
                            else if (scene6)
                            {
                                chemin1to4();
                            }
                            else if (scene7)
                            {
                                chemin1to5();
                            }
                            else if (scene8)
                            {
                                chemin1to6();
                            }
                            else if (scene9)
                            {
                                chemin1to7();
                            }
                            else if (scene10)
                            {
                                chemin1to8();
                            }
                        }
                        else if (scene4)
                        {
                            if (scene5)
                            {
                                chemin2to3();
                            }
                            else if (scene6)
                            {
                                chemin2to4();
                            }
                            else if (scene7)
                            {
                                chemin2to5();
                            }
                            else if (scene8)
                            {
                                chemin2to6();
                            }
                            else if (scene9)
                            {
                                chemin2to7();
                            }
                            else if (scene10)
                            {
                                chemin2to8();
                            }
                        }
                        else if (scene5)
                        {
                            if (scene6)
                            {
                                chemin3to4();
                            }
                            else if (scene7)
                            {
                                chemin3to5();
                            }
                            else if (scene8)
                            {
                                chemin3to6();
                            }
                            else if (scene9)
                            {
                                chemin3to7();
                            }
                            else if (scene10)
                            {
                                chemin3to8();
                            }
                        }
                        else if (scene6)
                        {
                            if (scene7)
                            {
                                chemin4to5();
                            }
                            else if (scene8)
                            {
                                chemin4to6();
                            }
                            else if (scene9)
                            {
                                chemin4to7();
                            }
                            else if (scene10)
                            {
                                chemin4to8();
                            }
                        }
                        else if (scene7)
                        {
                            if (scene8)
                            {
                                chemin5to6();
                            }
                            else if (scene9)
                            {
                                chemin5to7();
                            }
                            else if (scene10)
                            {
                                chemin5to8();
                            }
                        }
                        else if (scene8)
                        {
                            if (scene9)
                            {
                                chemin6to7();
                            }
                            else if (scene10)
                            {
                                chemin6to8();
                            }
                        }
                        break;

                    case 2:
                        if (scene4)
                        {
                            if (scene5)
                            {
                                chemin2to3();
                            }
                            else if (scene6)
                            {
                                chemin2to4();
                            }
                            else if (scene7)
                            {
                                chemin2to5();
                            }
                            else if (scene8)
                            {
                                chemin2to6();
                            }
                            else if (scene9)
                            {
                                chemin2to7();
                            }
                            else if (scene10)
                            {
                                chemin2to8();
                            }
                        }
                        else if (scene5)
                        {
                            if (scene6)
                            {
                                chemin3to4();
                            }
                            else if (scene7)
                            {
                                chemin3to5();
                            }
                            else if (scene8)
                            {
                                chemin3to6();
                            }
                            else if (scene9)
                            {
                                chemin3to7();
                            }
                            else if (scene10)
                            {
                                chemin3to8();
                            }
                        }
                        else if (scene6)
                        {
                            if (scene7)
                            {
                                chemin4to5();
                            }
                            else if (scene8)
                            {
                                chemin4to6();
                            }
                            else if (scene9)
                            {
                                chemin4to7();
                            }
                            else if (scene10)
                            {
                                chemin4to8();
                            }
                        }
                        else if (scene7)
                        {
                            if (scene8)
                            {
                                chemin5to6();
                            }
                            else if (scene9)
                            {
                                chemin5to7();
                            }
                            else if (scene10)
                            {
                                chemin5to8();
                            }
                        }
                        else if (scene8)
                        {
                            if (scene9)
                            {
                                chemin6to7();
                            }
                            else if (scene10)
                            {
                                chemin6to8();
                            }
                        }
                        break;

                    case 3:
                        if (scene5)
                        {
                            if (scene6)
                            {
                                chemin3to4();
                            }
                            else if (scene7)
                            {
                                chemin3to5();
                            }
                            else if (scene8)
                            {
                                chemin3to6();
                            }
                            else if (scene9)
                            {
                                chemin3to7();
                            }
                            else if (scene10)
                            {
                                chemin3to8();
                            }
                        }

                        else if (scene6)
                        {
                            if (scene7)
                            {
                                chemin4to5();
                            }
                            else if (scene8)
                            {
                                chemin4to6();
                            }
                            else if (scene9)
                            {
                                chemin4to7();
                            }
                            else if (scene10)
                            {
                                chemin4to8();
                            }
                        }

                        else if (scene7)
                        {
                            if (scene8)
                            {
                                chemin5to6();
                            }
                            else if (scene9)
                            {
                                chemin5to7();
                            }
                            else if (scene10)
                            {
                                chemin5to8();
                            }
                        }

                        else if (scene8)
                        {
                            if (scene9)
                            {
                                chemin6to7();
                            }
                            else if (scene10)
                            {
                                chemin6to8();
                            }
                        }
                        break;

                    case 4:
                        if (scene6)
                        {
                            if (scene7)
                            {
                                chemin4to5();
                            }
                            else if (scene8)
                            {
                                chemin4to6();
                            }
                            else if (scene9)
                            {
                                chemin4to7();
                            }
                            else if (scene10)
                            {
                                chemin4to8();
                            }
                        }
                        else if (scene7)
                        {
                            if (scene8)
                            {
                                chemin5to6();
                            }
                            else if (scene9)
                            {
                                chemin5to7();
                            }
                            else if (scene10)
                            {
                                chemin5to8();
                            }
                        }
                        else if (scene8)
                        {
                            if (scene9)
                            {
                                chemin6to7();
                            }
                            else if (scene10)
                            {
                                chemin6to8();
                            }
                        }
                        break;

                    case 5:
                        if (scene7)
                        {
                            if (scene8)
                            {
                                chemin5to6();
                            }
                            else if (scene9)
                            {
                                chemin5to7();
                            }
                            else if (scene10)
                            {
                                chemin5to8();
                            }
                        }
                        else if (scene8)
                        {
                            if (scene9)
                            {
                                chemin6to7();
                            }
                            else if (scene10)
                            {
                                chemin6to8();
                            }
                        }
                        break;

                    case 6:
                        if (scene8)
                        {
                            if (scene9)
                            {
                                chemin6to7();
                            }
                            else if (scene10)
                            {
                                chemin6to8();
                            }
                        }
                        break;

                    default:
                        break;
                    }
                }
            }
        }
    }