// load all members from hard disk public void LoadAll( ) { gold = PlayerPrefs.GetInt("gold"); m_playerName = PlayerPrefs.GetString("player name"); m_className = (GameCode.ClassName)PlayerPrefs.GetInt("class index"); m_birthName = (GameCode.BirthAndGiftName)PlayerPrefs.GetInt("birth index"); m_pointsToSpend = PlayerPrefs.GetInt("points to spend"); exp = PlayerPrefs.GetInt("exp"); level = PlayerPrefs.GetInt("level"); armPieRate = PlayerPrefs.GetFloat("armour piercing"); for (int i = 0; i < 6; i++) { m_basicAttributes[i] = PlayerPrefs.GetInt(((GameCode.BasicAttributeName)i).ToString()); } int classIndex = (int)m_className; hasLearned = new bool[GameCode.skillsAllClasses[classIndex].Count]; for (int i = 0; i < hasLearned.Length; i++) { hasLearned[i] = PlayerPrefs.GetInt(GameCode.skillsAllClasses[classIndex][i].ToString()) == 1; } #region general attributes curLife = PlayerPrefs.GetFloat("curLife"); maxLife = PlayerPrefs.GetFloat("maxLife"); curMana = PlayerPrefs.GetFloat("curMana"); maxMana = PlayerPrefs.GetFloat("maxMana"); atk = PlayerPrefs.GetFloat("atk"); maxAtk = PlayerPrefs.GetFloat("maxAtk"); def = PlayerPrefs.GetFloat("def"); maxDef = PlayerPrefs.GetFloat("maxDef"); crit = PlayerPrefs.GetFloat("crit"); critRate = PlayerPrefs.GetFloat("critRate"); hitRate = PlayerPrefs.GetFloat("hitRate"); atkSpeed = PlayerPrefs.GetFloat("atkSpeed"); moveSpeed = PlayerPrefs.GetFloat("moveSpeed"); healingRate = PlayerPrefs.GetFloat("healingRate"); manaingRate = PlayerPrefs.GetFloat("manaingRate"); dodgeRate = PlayerPrefs.GetFloat("dodgeRate"); #endregion }
public void SetBirth(GameCode.BirthAndGiftName _birth) { m_birthName = _birth; switch (m_birthName) { // extra 300 init gold case GameCode.BirthAndGiftName.Businessman: break; // only 200 init gold, but faster growness case GameCode.BirthAndGiftName.Genius: break; // small littel cost when buy something in a city case GameCode.BirthAndGiftName.Nobility: break; // nothing can we gain at first case GameCode.BirthAndGiftName.Nothing: break; // a unkown stone, will generate extra award when player completes a quest case GameCode.BirthAndGiftName.Protagonist: break; // tp with cd case GameCode.BirthAndGiftName.Risker: break; // unlocking skill case GameCode.BirthAndGiftName.Rogue: break; default: break; } }