private void InitializeComps() { for (int i = 0; i < this.def.comps.Count; i++) { WorldObjectComp worldObjectComp = (WorldObjectComp)Activator.CreateInstance(this.def.comps[i].compClass); worldObjectComp.parent = this; this.comps.Add(worldObjectComp); worldObjectComp.Initialize(this.def.comps[i]); } }
private void InitializeComps() { for (int i = 0; i < def.comps.Count; i++) { WorldObjectComp worldObjectComp = null; try { worldObjectComp = (WorldObjectComp)Activator.CreateInstance(def.comps[i].compClass); worldObjectComp.parent = this; comps.Add(worldObjectComp); worldObjectComp.Initialize(def.comps[i]); } catch (Exception arg) { Log.Error("Could not instantiate or initialize a WorldObjectComp: " + arg); comps.Remove(worldObjectComp); } } }