public static void SerializableTable(string[] valuesList, int skey, Dictionary <int, List <object> > _hash) { if ((int)_ID.MAX_RECORD != valuesList.Length) { throw TableException.ErrorReader("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", GetInstanceFile(), _ID.MAX_RECORD, valuesList.Length); } Tab_AnimationEvent _values = new Tab_AnimationEvent(); _values.m_AnimationClipName = valuesList[(int)_ID.ID_ANIMATIONCLIPNAME] as string; _values.m_FunctionName = valuesList[(int)_ID.ID_FUNCTIONNAME] as string; _values.m_Id = Convert.ToInt32(valuesList[(int)_ID.ID_ID] as string); _values.m_PrefabName = valuesList[(int)_ID.ID_PREFABNAME] as string; _values.m_Time = Convert.ToSingle(valuesList[(int)_ID.ID_TIME] as string); if (_hash.ContainsKey(skey)) { List <object> tList = _hash[skey]; tList.Add(_values); } else { List <object> tList = new List <object>(); tList.Add(_values); _hash.Add(skey, (List <object>)tList); } }
public static bool InitTable_AnimationEvent() { g_AnimationEvent.Clear(); Dictionary <int, List <object> > tmps = new Dictionary <int, List <object> >(); if (!Tab_AnimationEvent.LoadTable(tmps)) { return(false); } foreach (KeyValuePair <int, List <object> > kv in tmps) { List <Tab_AnimationEvent> values = new List <Tab_AnimationEvent>(); foreach (object subit in kv.Value) { values.Add((Tab_AnimationEvent)subit); } g_AnimationEvent.Add(kv.Key, values); } return(true); }