Пример #1
0
    public void _voice_use()
    {
        if (ES2.Exists("voice"))
        {
            if (ES2.Load <int>("voice") > 0)
            {
                open_panel.SetActive(true);
                gameManager.GetComponent <GameManager>().soundManager.GetComponent <AudioSource>().enabled = false;
            }
            else
            {
                //open_panel2.SetActive(true);
            }
            //조건


            /*
             * if (Application.loadedLevelName == "1.Game")
             * {
             *      gameManager.GetComponent<GameManager>().soundManager.GetComponent<AudioSource>().enabled = false;
             *      //gameManager.GetComponent<GameManager>().soundManagerOff();
             * }
             *
             * if (Application.loadedLevelName == "0.Main")
             * {
             *
             * }*/
        }
    }
Пример #2
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";
                }
            }
        }
    }
Пример #3
0
    /// <summary>
    /// sets Default gfx settings
    /// </summary>
    void gfx_setDefaults()
    {
        //retrieve previous setting
        #if !EMM_ES2
        toggleFullscreen             = PlayerPrefs.GetInt("toggleFullscreen", 1);
        toggleAnisoFilt              = PlayerPrefs.GetInt("toggleAnisoFilt", 1);
        toggleVsync                  = PlayerPrefs.GetInt("toggleVsync", 1);
        toggleShadows                = PlayerPrefs.GetInt("toggleShadows", 1);
        toggleTextureQuality         = PlayerPrefs.GetInt("toggleTextureQuality", 1);
        toggleAntiAlias              = PlayerPrefs.GetInt("toggleAntiAlias", 1);
        currentScreenResolutionCount = PlayerPrefs.GetInt("currentScreenResolutionCount", currentScreenResolutionCount);
        #else
        toggleFullscreen             = ES2.Exists("toggleFullscreen") ? ES2.Load <int>("toggleFullscreen") : 1;
        toggleAnisoFilt              = ES2.Exists("toggleAnisoFilt") ? ES2.Load <int>("toggleAnisoFilt") : 1;
        toggleVsync                  = ES2.Exists("toggleVsync") ? ES2.Load <int>("toggleVsync") : 1;
        toggleShadows                = ES2.Exists("toggleShadows") ? ES2.Load <int>("toggleShadows") : 1;
        toggleTextureQuality         = ES2.Exists("toggleTextureQuality") ? ES2.Load <int>("toggleTextureQuality") : 1;
        toggleAntiAlias              = ES2.Exists("toggleAntiAlias") ? ES2.Load <int>("toggleAntiAlias") : 1;
        currentScreenResolutionCount = ES2.Exists("currentScreenResolutionCount") ? ES2.Load <int>("currentScreenResolutionCount") : 1;
        #endif


        //set values accordingly
        gfx_setFullScreen();
        gfx_setAnisoFiltering();
        gfx_setAntiAlias();
        gfx_setVsync();
        gfx_setShadows();
        gfx_setTextureQuality();
        gfx_setScreenResolution();
    }
Пример #4
0
    // -----------------------------
    //	monobehaviour
    // -----------------------------

    #region MonoBehaviour
    void Awake()
    {
        ////////////////////////////////////////////////////////////////////
        /// SINGLETON //////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////
        if (Instance == null)
        {
            Instance = this;
            DontDestroyOnLoad(this.gameObject);
        }
        else
        {
            Destroy(this.gameObject);
        }
        ////////////////////////////////////////////////////////////////////
        /// SINGLETON //////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////

        saveFileName = Application.persistentDataPath + "/SavesDir/saveData.sav";

        //load the data on awake IF the file exists
        if (ES2.Exists(saveFileName))
        {
            print("------- LOADING DATA FROM FILE --------");
            loadData();
        }
    }
Пример #5
0
 private void Awake()
 {
     if (ES2.Exists("controls"))
     {
         player.isbutton = ES2.Load <bool>("controls");
     }
 }
Пример #6
0
    /*
     * This is where we'll load our data.
     *
     */
    public void Start()
    {
        // If there's scene object data to load
        if (ES2.Exists(sceneObjectFile))
        {
            // Get how many scene objects we need to load, and then try to load each.
            // We load scene objects first as created objects may be children of them.
            int sceneObjectCount = ES2.Load <int>(sceneObjectFile + "?tag=sceneObjectCount");

            for (int i = 0; i < sceneObjectCount; i++)
            {
                LoadObject(i, sceneObjectFile);
            }
        }

        // If there's created objects to load
        if (ES2.Exists(createdObjectFile))
        {
            // Get how many created objects we need to load, and then try to load each.
            int createdObjectCount = ES2.Load <int>(createdObjectFile + "?tag=createdObjectCount");

            for (int i = 0; i < createdObjectCount; i++)
            {
                LoadObject(i, createdObjectFile);
            }
        }
    }
    /// <summary>
    /// check if the player has loaded the game from menu
    /// </summary>
    void hasLoadedGame()
    {
        //check if it's loaded from a slot
        if (loadedSlotId != 0)
        {
            //find the trigger which was used to save this slot

            //1. retrieve save trigger's id from saved data
            #if !EMM_ES2
            saveTriggerId = PlayerPrefs.GetInt("saveTriggerId_" + loadedSlotId);
            #else
            if (ES2.Exists("saveTriggerId_" + loadedSlotId))
            {
                saveTriggerId = ES2.Load <int>("saveTriggerId_" + loadedSlotId);
            }
            #endif

            //2. match it with all the available save triggers
            for (int i = 0; i < allTriggers.Length; i++)
            {
                //3. once the match is found
                if (allTriggers[i].saveTriggerId == saveTriggerId)
                {
                    //4. spawn player at that trigger's spawn point location
                    spawnPlayerAtPoint(allTriggers[i].spawnPoint);
                    saveName = allTriggers[i].saveName + loadedSlotId;
                }
            }
        }
    }
Пример #8
0
 public void GeneralLoad()
 {
     if (ES2.Exists("savas.txt?tag=highestScore"))
     {
         ScoreManage.highestScore = ES2.Load <int>("savas.txt?tag=highestScore");
     }
 }
Пример #9
0
 // Start is called before the first frame update
 void Start()
 {
     //Si la clef a été trouvée lors d'une sauvegarde ultérieure, la clef ne s'affiche pas
     if (ES2.Exists("trouve"))
     {
         Destroy(gameObject);
     }
 }
Пример #10
0
 private void Awake()
 {
     // loading if highscore data is exist
     if (ES2.Exists("HScore"))
     {
         highScoreCount = ES2.Load <int>("HScore");
     }
 }
Пример #11
0
 /// <summary>
 /// セーブデータをデリートします
 /// </summary>
 /// <param name="name">デリートしたいセーブデータの名前</param>
 public static void delete(string name)
 {
     if (!ES2.Exists(FILE_NAME + ".txt?tag=" + name))
     {
         return;
     }
     ES2.Delete(FILE_NAME + ".txt?tag=" + name);
 }
 /*
  * This is where we initialize our prefabs.
  */
 void Start()
 {
     // If there are saved prefabs to load, load them.
     if (ES2.Exists(filename))
     {
         LoadAllPrefabs();
     }
 }
Пример #13
0
 //Si l'utilisateur clique sur le bouton, on lance la scène correspondante
 public void onClic()
 {
     if (ES2.Exists("sceneACharger6"))
     {
         LevelToLoad = ES2.Load <string>("sceneACharger6");
         SceneManager.LoadScene(LevelToLoad);
     }
 }
Пример #14
0
 private void LoadPosition()
 {
     if (!ES2.Exists(GetFullFilename("position"), settings))
     {
         return;
     }
     transform.position = ES2.Load <Vector3>(GetFullFilename("position"), settings);
 }
Пример #15
0
 private void LoadRotation()
 {
     if (!ES2.Exists(GetFullFilename("rotation"), settings))
     {
         return;
     }
     transform.rotation = ES2.Load <Quaternion>(GetFullFilename("rotation"), settings);
 }
Пример #16
0
 private void LoadScale()
 {
     if (!ES2.Exists(GetFullFilename("scale"), settings))
     {
         return;
     }
     transform.localScale = ES2.Load <Vector3>(GetFullFilename("scale"), settings);
 }
    void delete()
    {
        //On supprime les sauvegardes de la partie précédente
        if (ES2.Exists("position"))
        {
            ES2.Delete("position");
        }

        if (ES2.Exists("rotation"))
        {
            ES2.Delete("rotation");
        }


        if (ES2.Exists("savedScene"))
        {
            ES2.Delete("savedScene");
        }

        if (ES2.Exists("score"))
        {
            ES2.Delete("score");
        }

        if (ES2.Exists("temps"))
        {
            ES2.Delete("temps");
        }

        if (ES2.Exists("bool"))
        {
            ES2.Delete("bool");
        }

        if (ES2.Exists("trouve"))
        {
            ES2.Delete("trouve");
        }

        if (ES2.Exists("code"))
        {
            ES2.Delete("code");
        }

        sceneCount = UnityEngine.SceneManagement.SceneManager.sceneCountInBuildSettings;
        for (int i = 1; i < sceneCount; i++)
        {
            if (ES2.Exists("scene" + i))
            {
                ES2.Delete("scene" + i);
            }

            if (ES2.Exists("sceneACharger" + i))
            {
                ES2.Delete("sceneACharger" + i);
            }
        }
    }
Пример #18
0
 void ReloadPickups()
 {
     if (!ES2.Exists("pickups"))
     {
         return;
     }
     pickupIndices = ES2.LoadList <int>("pickups");
     MapGeneration.instance.UpdatePickedUpPickups(pickupIndices);
 }
Пример #19
0
 void getHighScore()
 {
     if (ES2.Exists(levelOneScoreKey))
     {
         levelOneScore          = ES2.Load <float> (levelOneScoreKey);
         levelOneScore          = (float)System.Math.Round(levelOneScore, 2);
         levelOneScoreText.text = levelOneScore.ToString();
     }
 }
Пример #20
0
 public static T getValue <T>(string tag)
 {
     tag = tagStr + tag;
     if (ES2.Exists(tag))
     {
         return(ES2.Load <T>(tag));
     }
     return(default(T));
 }
Пример #21
0
    private void Awake()
    {
        SoundManager SM = GameObject.FindObjectOfType <SoundManager>();

        if (ES2.Exists("volume"))
        {
            SM.volume = ES2.Load <int>("volume");
        }
    }
Пример #22
0
 public bool ResetCharacterData()
 {
     if (ES2.Exists("chui/CharacterData"))
     {
         Debug.Log("CharacterData found! This data will delete");
         ES2.Delete("chui/CharacterData");
     }
     return(true);
 }
Пример #23
0
    // Use this for initialization
    void Start()
    {
        endLevel = endLevelObject.GetComponent <EndLevel> ();

        if (ES2.Exists(saveKeyString))
        {
            currentBestTime = ES2.Load <float>(saveKeyString);
        }
    }
Пример #24
0
        public void DeleteWatchCount(int id)
        {
            string tag = GetWatchCountTag(id);

            if (ES2.Exists(tag))
            {
                ES2.Delete(tag);
            }
        }
Пример #25
0
        public static void CreateJsonVaultFiles(string path)
        {
            try
            {
                path = path + "/VaultFiles";

                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }

                string[] vaultFiles = ES2.GetFiles(string.Empty, "*.txt");
                List <SavedGunSerializable> savedGuns = new List <SavedGunSerializable>();
                foreach (string name in vaultFiles)
                {
                    try
                    {
                        if (name.Contains("DONTREMOVETHISPARTOFFILENAMEV02a"))
                        {
                            if (ES2.Exists(name))
                            {
                                using (ES2Reader reader = ES2Reader.Create(name))
                                {
                                    savedGuns.Add(new SavedGunSerializable(reader.Read <SavedGun>("SavedGun")));
                                }
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        TNHTweakerLogger.LogError("Vault File could not be loaded");
                    }
                }

                foreach (SavedGunSerializable savedGun in savedGuns)
                {
                    if (File.Exists(path + "/" + savedGun.FileName + ".json"))
                    {
                        File.Delete(path + "/" + savedGun.FileName + ".json");
                    }

                    // Create a new file
                    using (StreamWriter sw = File.CreateText(path + "/" + savedGun.FileName + ".json"))
                    {
                        string characterString = JsonConvert.SerializeObject(savedGun, Formatting.Indented, new StringEnumConverter());
                        sw.WriteLine(characterString);
                        sw.Close();
                    }
                }
            }

            catch (Exception ex)
            {
                TNHTweakerLogger.LogError(ex.ToString());
            }
        }
    private void Build_Summary_Scores()
    {
        //load vars

        //saves total
        m_stats_saves_total = m_score_positive;
        if (ES2.Exists("cannon_total_saves"))
        {
            m_stats_saves_total += ES2.Load <int>("cannon_total_saves");
            //Debug.Log("total is " + m_stats_saves_total);
        }
        //record
        if (ES2.Exists("cannon_record"))
        {
            m_stats_record = Mathf.Max(m_score_positive, ES2.Load <int>("cannon_record"));

            //record fireworks and tween
            if (m_score_positive > ES2.Load <int>("cannon_record"))
            {
                m_ui_world.Game_Events("summary record");
            }
        }
        else
        {
            m_stats_record = m_score_positive;
        }
        //games played
        m_stats_games_played = 1;
        if (ES2.Exists("cannon_games_played"))
        {
            m_stats_games_played += ES2.Load <int>("cannon_games_played");
        }

        //saving
        ES2.Save(m_stats_saves_total, "cannon_total_saves");
        ES2.Save(m_stats_record, "cannon_record");
        ES2.Save(m_stats_games_played, "cannon_games_played");


        //buid ui array
        score_array[0] = "Score: " + m_score_positive;                                //round score
        score_array[1] = "Saves made: " + m_stats_saves;                              //saves made
        score_array[2] = "Goals allowed: " + m_stats_allowed;                         //goals allowed
        score_array[3] = "Round time: " + Seconds_to_time(m_stats_time);              //round time
        score_array[4] = "Games played: " + m_stats_games_played;                     // games played
        score_array[5] = "Total saves: " + m_stats_saves_total;                       // total saves
        score_array[6] = "World: TOP <color=#5ACFFFFF> " + m_stats_best + "</color>"; // best round points
        score_array[7] = "Record: " + m_stats_record;                                 // 7 days record
        //score_array[8] = "World position: " + m_stats_world; // word position
        Debug.Log(score_array);

        m_ui_world.Show_Summary("cannon", score_array);

        //memory bank
        m_memory_bank.Earned = m_score_positive / 10;
    }
Пример #27
0
        public int LoadWatchCount(int id)
        {
            string tag = GetWatchCountTag(id);

            if (ES2.Exists(tag))
            {
                return(ES2.Load <int> (tag));
            }
            return(0);
        }
Пример #28
0
 void ReadLevelsFromPref()
 {
     for (int i = 0; i < modelsCount; i++)
     {
         if (ES2.Exists("model" + i))
         {
             allModels.Add(ES2.Load <Datas>("model" + i));
         }
     }
 }
Пример #29
0
    // Load Camera Position and its zoom info
    void LoadCameraInfo()
    {
        if (ES2.Exists("camera.txt?tag=camTransform" + SaveManager.currentProjID) && ES2.Exists("camera.txt?tag=camZoomInfo" + SaveManager.currentProjID))
        {
            Camera.main.transform.position = ES2.Load <Transform>("camera.txt?tag=camTransform" + SaveManager.currentProjID).position;
            Camera.main.transform.rotation = ES2.Load <Transform>("camera.txt?tag=camTransform" + SaveManager.currentProjID).rotation;

            Camera.main.orthographicSize = ES2.Load <float>("camera.txt?tag=camZoomInfo" + SaveManager.currentProjID);
        }
    }
Пример #30
0
 private WorldCreatFlugHelper()
 {
     PioneerManager.getInstance().setObserver(this);
     if (ES2.Exists("BasicData"))
     {
         ES2Reader reader = ES2Reader.Create("BasicData");
         this.worldPasses    = reader.ReadList <Int32>("WorldPass");
         this.worldIdDefault = reader.Read <Int32>("WorldIdDefault");
     }
 }