void Awake() { //GameTool.DeleteAll();//测试用 if (!GameTool.HasKey("CurrentLevel")) { GameTool.SetInt("CurrentLevel", 1); currentMaxLevel = 1; } else { currentMaxLevel = GameTool.GetInt("CurrentLevel"); } }
public void InitData() { if (!GameTool.HasKey("CoinCount")) { GameTool.SetInt("CoinCount", 100); } coinCount = GameTool.GetInt("CoinCount"); if (!GameTool.HasKey("RedCount")) { GameTool.SetInt("RedCount", 20); } redCount = GameTool.GetInt("RedCount"); }
//对外提供的,修改红药水的方法 public void EditorRedCount(int newRedCount) { redCount = newRedCount; GameTool.SetInt("RedCount", newRedCount); }
//对外提供的,修改金币数量的方法 public void EditorCoinCount(int newCoinCount) { coinCount = newCoinCount; GameTool.SetInt("CoinCount", newCoinCount); }
public void SetCurrentMaxLevel(int currentLevel) { this.currentMaxLevel = currentLevel; GameTool.SetInt("CurrentLevel", currentLevel); }