public List <string> LoadFromString(GameObjectList list, string dataString) { List <string> errorMsg = new List <string>(); char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries); this.Clear(); try { foreach (string str in strArray) { GameObject gameObject = list.GetGameObject(int.Parse(str)); if (gameObject != null) { this.Add(gameObject); } else { errorMsg.Add("人物ID" + str + "不存在"); } } } catch { errorMsg.Add("多项人物一栏应为半型空格分隔的称号ID"); } return(errorMsg); }
public void LoadFromString(GameObjectList list, string dataString) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries); this.Clear(); foreach (string str in strArray) { GameObject gameObject = list.GetGameObject(int.Parse(str)); if (gameObject != null) { this.Add(gameObject); } } }
public void LoadFromString(GameObjectList list, string dataString) { char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries); this.Clear(); foreach (string str in strArray) { GameObject gameObject = list.GetGameObject(int.Parse(str)); if (gameObject != null) { this.Add(gameObject); } } }
public List<string> LoadFromString(GameObjectList list, string dataString) { List<string> errorMsg = new List<string>(); char[] separator = new char[] { ' ', '\n', '\r', '\t' }; string[] strArray = dataString.Split(separator, StringSplitOptions.RemoveEmptyEntries); this.Clear(); try { foreach (string str in strArray) { GameObject gameObject = list.GetGameObject(int.Parse(str)); if (gameObject != null) { this.Add(gameObject); } else { errorMsg.Add("人物ID" + str + "不存在"); } } } catch { errorMsg.Add("多项人物一栏应为半型空格分隔的称号ID"); } return errorMsg; }