示例#1
0
 //Si l'utilisateur clique sur le bouton, on lance la scène correspondante
 public void onClic()
 {
     if (ES2.Exists("sceneACharger7"))
     {
         LevelToLoad = ES2.Load <string>("sceneACharger7");
         SceneManager.LoadScene(LevelToLoad);
     }
 }
示例#2
0
 void getHighScore()
 {
     if (ES2.Exists(levelOneScoreKey))
     {
         levelOneScore          = ES2.Load <float> (levelOneScoreKey);
         levelOneScore          = (float)System.Math.Round(levelOneScore, 2);
         levelOneScoreText.text = levelOneScore.ToString();
     }
 }
示例#3
0
        /// <summary>
        /// Load a generic saved param with its tag
        /// </summary>
        /// <typeparam name="T">The generic Type.</typeparam>
        /// <param name="_key">The tag under which a value is saved</param>
        /// <param name="_defaultValue">Its default value if not existing. The type default value if nothing specified</param>
        /// <param name="_saveFile">The specific filename in which EasySave will read from. Uses a default file if empty.</param>
        /// <returns>A saved value if saving system has the key</returns>
        public T Load <T>(string _key, T _defaultValue = default(T), string _saveFile = "")
        {
            if (!HasKey(_key, _saveFile))
            {
                return(_defaultValue);
            }

            return(ES2.Load <T>(globalSavePath + "/" + GetFileSave_Name(_saveFile) + "?tag=" + _key, es2Settings));
        }
示例#4
0
文件: GameSetting.cs 项目: rfHu/poker
 public static T getValue <T>(string tag)
 {
     tag = tagStr + tag;
     if (ES2.Exists(tag))
     {
         return(ES2.Load <T>(tag));
     }
     return(default(T));
 }
示例#5
0
    public void Load()
    {
        leveltoload = ES2.Load <string>("savedScene");
        SceneManager.LoadScene(leveltoload);

        Score.coinAmount = ES2.Load <int>("score");
        Life.life        = ES2.Load <double>("life");
        CharacterSelection.idCharacter = ES2.Load <int>("ID");
    }
示例#6
0
    private void Awake()
    {
        SoundManager SM = GameObject.FindObjectOfType <SoundManager>();

        if (ES2.Exists("volume"))
        {
            SM.volume = ES2.Load <int>("volume");
        }
    }
示例#7
0
	// Use this for initialization
	void Start () 
	{
		ES2.Save (123, "myfile.txt?tag=ch");	

		int myint = ES2.Load<int> ("myfile.txt?tag=ch");

		text.text = myint.ToString();
		Debug.Log (myint);
	}
示例#8
0
    // Use this for initialization
    void Start()
    {
        endLevel = endLevelObject.GetComponent <EndLevel> ();

        if (ES2.Exists(saveKeyString))
        {
            currentBestTime = ES2.Load <float>(saveKeyString);
        }
    }
 public void Load()
 {
     player.transform.position = ES2.Load <Vector3>("position");
     this.ZoneSpawn.GetComponent <LifeScript>().Score = ES2.Load <float>("score");
     //Calcul du temps
     this.MainCamera.GetComponent <Timer>().minutes  = ES2.Load <int>("minutes");
     this.MainCamera.GetComponent <Timer>().secondes = ES2.Load <int>("secondes");
     //this.MainCamera.GetComponent<Timer>().temps = ES2.Load<int>("temps");
 }
示例#10
0
    // Use this for initialization
    void Start()
    {
        //path = Application.dataPath + "/User.txt";
        _audio = GetComponent <AudioSource> ();
        path   = LoadInformation._path;

        _normalVolume.value     = ES2.Load <float>(path + "?tag=normalVolume");
        _backgroundVolume.value = ES2.Load <float>(path + "?tag=backgroundVolume");
    }
    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;
    }
示例#12
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);
        }
    }
示例#13
0
 public void OnEarnedTJPoints(int amount)
 {
     DataManger.Instance.GAMEDATA.Gold += ES2.Load <int>(DataManger.DataFilename + "?tag=gettedGolds");
     ES2.Save(0, DataManger.DataFilename + "?tag=gettedGolds");
     if (UserName.Instance != null)
     {
         UserName.Instance.UpdateCurrencyNums();
     }
     DataManger.Instance.SaveData();
 }
示例#14
0
        public int LoadWatchCount(int id)
        {
            string tag = GetWatchCountTag(id);

            if (ES2.Exists(tag))
            {
                return(ES2.Load <int> (tag));
            }
            return(0);
        }
示例#15
0
 public void LoadAllMainScene()
 {
     if (SceneManager.GetActiveScene().name == "MainScene")
     {
         if (ES2.Exists("savas.txt?tag=coins"))
         {
             CoinManager.currentCoins = ES2.Load <int>("savas.txt?tag=coins");
         }
     }
 }
示例#16
0
 void ReadLevelsFromPref()
 {
     for (int i = 0; i < modelsCount; i++)
     {
         if (ES2.Exists("model" + i))
         {
             allModels.Add(ES2.Load <Datas>("model" + i));
         }
     }
 }
示例#17
0
 void Start()
 {
     //path = Application.dataPath + "/User.txt";
     _playerName.text        = ES2.Load <string>(path + "?tag=name");
     level                   = (int)(PlayerManager.Instance._exp / 100);
     tmpLevel                = level;
     _backgroundVolume.value = ES2.Load <float>(path + "?tag=backgroundVolume");
     _audio                  = GetComponent <AudioSource> ();
     _audio.volume           = _backgroundVolume.value;
 }
示例#18
0
    /// <summary>
    /// Initializer
    /// </summary>
    static GameData()
    {
        #region Default states

        _rank                 = 1;
        _money                = 0;
        _upgradeLevelBoots    = 1;
        _upgradeLevelSword    = 1;
        _upgradeLevelWhip     = 1;
        _upgradeLevelCrossbow = 1;
        _equippedWeapon       = Constants.weapon_sword;
        _settingSound         = true;

        #endregion

        if (ES2.Exists(Constants.data_rank))
        {
            _rank = ES2.Load <int>(Constants.data_rank);
        }

        if (ES2.Exists(Constants.data_money))
        {
            _money = ES2.Load <int>(Constants.data_money);
        }

        if (ES2.Exists(Constants.data_upgrade_boots))
        {
            _upgradeLevelBoots = ES2.Load <int>(Constants.data_upgrade_boots);
        }

        if (ES2.Exists(Constants.data_upgrade_sword))
        {
            _upgradeLevelSword = ES2.Load <int>(Constants.data_upgrade_sword);
        }

        if (ES2.Exists(Constants.data_upgrade_whip))
        {
            _upgradeLevelWhip = ES2.Load <int>(Constants.data_upgrade_whip);
        }

        if (ES2.Exists(Constants.data_upgrade_crossbow))
        {
            _upgradeLevelCrossbow = ES2.Load <int>(Constants.data_upgrade_crossbow);
        }

        if (ES2.Exists(Constants.data_equipped_weapon))
        {
            _equippedWeapon = ES2.Load <string>(Constants.data_equipped_weapon);
        }

        if (ES2.Exists(Constants.settings_sound))
        {
            _settingSound = ES2.Load <bool>(Constants.settings_sound);
        }
    }
示例#19
0
    // End of - Load Store Class Objects

    // Load Achievements Class Objects
    public int LoadAchievementValues(int achID)
    {
        int achValue = 0;

        if (ES2.Exists("svt.txt?tag=achValue" + achID))
        {
            achValue = ES2.Load <int>("svt.txt?tag=achValue" + achID);
        }

        return(achValue);
    }
示例#20
0
    // Load the player email
    public static string LoadEmail()
    {
        string email = "";

        if (ES2.Exists("gepr?tag=email"))
        {
            email = ES2.Load <string>("gepr?tag=email");
        }

        return(email);
    }
    /*
     * This method will load all of the saved prefabs when called.
     */
    void LoadAllPrefabs()
    {
        // Load our prefab count so we know how many prefabs to load.
        int prefabCount = ES2.Load <int>(filename + "?tag=prefabCount");

        // Load each prefab using a for loop.
        for (int i = 0; i < prefabCount; i++)
        {
            LoadPrefab(i);
        }
    }
示例#22
0
 // Update is called once per frame
 void Update()
 {
     //音效
     _normalVolume     = ES2.Load <float>(path + "?tag=normalVolume");
     _backgroundVolume = ES2.Load <float>(path + "?tag=backgroundVolume");
     volume            = _normalVolume;
     if (this.tag == "Fx")
     {
         volume = _backgroundVolume;
     }
 }
示例#23
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);
            }
        }
示例#24
0
    public int LoadTotalXP()
    {
        int totalXP = 0;

        if (ES2.Exists("svt.txt?tag=totalXP"))
        {
            totalXP = ES2.Load <int>("svt.txt?tag=totalXP");
        }

        return(totalXP);
    }
示例#25
0
    // Load XP Class Objects
    public int LoadCurrentLevel()
    {
        int currLevel = 0;

        if (ES2.Exists("svt.txt?tag=currLevel"))
        {
            currLevel = ES2.Load <int>("svt.txt?tag=currLevel");
        }

        return(currLevel);
    }
示例#26
0
    public int LoadAllTimeMaxScore()
    {
        int allTimeMaxScore = 0;

        if (ES2.Exists("svt.txt?tag=allTimeMaxScore"))
        {
            allTimeMaxScore = ES2.Load <int>("svt.txt?tag=allTimeMaxScore");
        }

        return(allTimeMaxScore);
    }
示例#27
0
    public int LoadNumberOfQuestions(string topicName)
    {
        int totalQuestions = 0;

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

        return(totalQuestions);
    }
示例#28
0
    public int LoadQCountForTopics(string topicName)
    {
        int eachQAnswerCount = 0;

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

        return(eachQAnswerCount);
    }
示例#29
0
    public int LoadTotalPlayTime()
    {
        int quizTime = 0;

        if (ES2.Exists("svt.txt?tag=quizTime"))
        {
            quizTime = ES2.Load <int>("svt.txt?tag=quizTime");
        }

        return(quizTime);
    }
示例#30
0
    public int LoadPerkLevel(int perkID)
    {
        int perkLvl = 0;

        if (ES2.Exists("svt.txt?tag=perkLvl" + perkID))
        {
            perkLvl = ES2.Load <int>("svt.txt?tag=perkLvl" + perkID);
        }

        return(perkLvl);
    }