Пример #1
0
 // Fill ResearchTable and Workbench with scrap on spawn.
 void OnEntitySpawned(BaseNetworkable entity)
 {
     if (entity is ResearchTable)
     {
         ResearchTable table   = entity as ResearchTable;
         Item          tuition = ItemManager.CreateByItemID(scrapID, 777);
         if (tuition != null)
         {
             tuition.MoveToContainer(table.inventory, 1, true);
         }
     }
     else if (entity is Workbench)
     {
         Workbench bench   = entity as Workbench;
         Item      tuition = ItemManager.CreateByItemID(scrapID, bench.GetScrapForExperiment());
         if (tuition != null)
         {
             tuition.MoveToContainer(bench.inventory, 1, true);
         }
     }
 }