public void setTrainDifficulty(int selected) { TrainDifficulty = selected; Assets.Script.MyIni ini = new Assets.Script.MyIni(); ini.WriteIniContent("GameContent", "Speed", TrainDifficulty.toString()); Debug_Log.Call_WriteLog("TrainDifficulty=" + TrainDifficulty, selected.toString(), "Unity"); Debug.Log(selected); //if (selected) //{ //} //else { //} }
//public static ArrayList ContentList = new ArrayList() ; public void setContent(string selected) { Toggle Content_Ele = GameObject.Find("Content_" + selected).transform.GetComponentsInChildren <Toggle>()[0]; Debug_Log.Call_WriteLog(Content_Ele.isOn, "点击" + selected.toString(), "Unity"); ArrayList ContentList = new ArrayList(); Assets.Script.ReadIniPar ReadIniPargetParme = Assets.Script.getPar.getParme(); ArrayList bContent = new ArrayList(ReadIniPargetParme.Content.Split(',')); if (!System.String.IsNullOrEmpty(ReadIniPargetParme.Content))///如果读取到值了就赋值 { ContentList = bContent; } // TrainTime = selected; if (ContentList.Contains(selected) && !Content_Ele.isOn) { ContentList.Remove(selected); } else if (!ContentList.Contains(selected) && Content_Ele.isOn) { ContentList.Add(selected); } string str = string.Join(",", (string[])ContentList.ToArray(typeof(string))); Assets.Script.MyIni ini = new Assets.Script.MyIni(); ini.WriteIniContent("GameContent", "Content", str); //转换成数组 //string strdddd = string.Join(",", (string[])ContentList.ToArray(typeof(string))); Debug_Log.Call_WriteLog("setContent=" + str, selected.toString(), "Unity"); Debug.Log(selected); //if (selected) //{ //} //else { //} }
public void setTrainTime(int selected) { TrainTime = selected; Assets.Script.MyIni ini = new Assets.Script.MyIni(); ini.WriteIniContent("GameContent", "LengthofTime", TrainTime.toString()); Debug_Log.Call_WriteLog("TrainTime=" + TrainTime, selected.toString(), "Unity"); Debug.Log(selected); //if (selected) //{ //} //else { //} }
public static ReadIniPar getParme() { ReadIniPar ddReadIniPardd = new ReadIniPar(); #region 获取参数 //获取ini文件 int LengthofTime = 0; int speed = 0; MyIni ini = new MyIni(); //获取Ini文件Time类型下的time对应的数值 LengthofTime = ini.ReadIniContent("GameContent", "LengthofTime").toInt32(); ///SelectTrainTime speed = ini.ReadIniContent("GameContent", "Speed").toInt32(); ///SelectTrainDifficulty string strContent = ini.ReadIniContent("GameContent", "Content"); #endregion 获取参数 ddReadIniPardd.LengthofTime = LengthofTime; ddReadIniPardd.speed = speed; ddReadIniPardd.Content = strContent; Debug_Log.Call_WriteLog(ddReadIniPardd, "读取的strpersistentDataPath", "Unity"); return(ddReadIniPardd); }