public static DemoVO GetConfig(int id) { if (_Data == null) { LoadVO(); } DemoVO data = null; _Data.TryGetValue(id, out data); return(data); }
public static void SetVO(string text) { DemoVO data = new DemoVO(); string[] tokens = Table.GetTokens(text); int.TryParse(tokens[0], out data.Id); if (tokens[1] != null) { data.Name = tokens[1]; } float.TryParse(tokens[2], out data.FloatCol); _Data[data.Id] = data; }
// Use this for initialization void Start() { Debug.LogError(DemoVO.GetConfig(1).Name); }