public void Init(bool isView) { m_isView = isView; try { Type[] types = GetSystemTypes(); for (int i = 0; i < types.Length; i++) { SystemBase tmp = (SystemBase)types[i].Assembly.CreateInstance(types[i].FullName); m_systemList.Add(tmp); tmp.m_world = this; tmp.Init(); } //初始化RecordSystemBase types = GetRecordSystemTypes(); for (int i = 0; i < types.Length; i++) { Type type = typeof(RecordSystem <>); type = type.MakeGenericType(types[i]); RecordSystemBase tmp = (RecordSystemBase)Activator.CreateInstance(type);; m_recordList.Add(tmp); m_recordDict.Add(types[i].Name, tmp); tmp.m_world = this; tmp.Init(); } } catch (Exception e) { Debug.LogError("WorldBase Init Exception:" + e.ToString()); } }
void InitRecordSystem() { //初始化RecordSystem Type[] types = GetRecordTypes(); for (int i = 0; i < types.Length; i++) { Type type = typeof(RecordSystem <>); type = type.MakeGenericType(types[i]); RecordSystemBase tmp = (RecordSystemBase)Activator.CreateInstance(type);; m_recordList.Add(tmp); m_recordDict.Add(types[i].Name, tmp); tmp.m_world = this; tmp.Init(); } }
void InitRecordSystem() { //初始化RecordSystem Type[] types = GetRecordTypes(); for (int i = 0; i < types.Length; i++) { if (types[i].IsSubclassOf(typeof(MomentComponentBase))) { Type type = typeof(RecordSystem <>); type = type.MakeGenericType(types[i]); RecordSystemBase tmp = (RecordSystemBase)Activator.CreateInstance(type);; m_recordList.Add(tmp); m_recordDict.Add(types[i].Name, tmp); tmp.m_world = this; tmp.Init(); } else { Debug.LogError(types[i].FullName + " not is MomentComponent!"); } } types = GetRecordSingletonTypes(); for (int i = 0; i < types.Length; i++) { if (types[i].IsSubclassOf(typeof(MomentSingletonComponent))) { Type type = typeof(RecordSingletonSystem <>); type = type.MakeGenericType(types[i]); RecordSystemBase tmp2 = (RecordSystemBase)Activator.CreateInstance(type);; m_recordList.Add(tmp2); m_recordDict.Add(types[i].Name, tmp2); tmp2.m_world = this; tmp2.Init(); } else { Debug.LogError(types[i].FullName + " not is MomentSingletonComponent!"); } } }