Пример #1
0
 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]);
     }
 }
Пример #2
0
 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);
         }
     }
 }