Ejemplo n.º 1
0
 protected override void OnCompleteWork(Worker worker)
 {
     base.OnCompleteWork(worker);
     if (session != null)
     {
         Storage component      = worker.GetComponent <Storage>();
         float   consumedAmount = session.GetConsumedAmount();
         if (consumedAmount > 0f)
         {
             SubstanceChunk      source      = session.GetSource();
             SimUtil.DiseaseInfo diseaseInfo = (session == null) ? SimUtil.DiseaseInfo.Invalid : session.GetDiseaseInfo();
             PrimaryElement      component2  = source.GetComponent <PrimaryElement>();
             Pickupable          component3  = LiquidSourceManager.Instance.CreateChunk(component2.Element, consumedAmount, session.GetTemperature(), diseaseInfo.idx, diseaseInfo.count, base.transform.GetPosition()).GetComponent <Pickupable>();
             component3.TotalAmount = consumedAmount;
             component3.Trigger(1335436905, source.GetComponent <Pickupable>());
             worker.workCompleteData = component3;
             Sim200ms(0f);
             if ((UnityEngine.Object)component3 != (UnityEngine.Object)null)
             {
                 component.Store(component3.gameObject, false, false, true, false);
             }
         }
         session.Cleanup();
         session = null;
     }
 }