Exemple #1
0
 private void UpdateProductionSound()
 {
     if (this.m_soundEmitter == null)
     {
         this.m_soundEmitter = new MyEntity3DSoundEmitter(base.Entity as MyEntity, false, 1f);
     }
     if (base.m_currentItemStatus >= 1f)
     {
         this.m_soundEmitter.StopSound(true, true);
     }
     else
     {
         bool?nullable;
         MyCraftingComponentBase.MyBlueprintToProduce currentItemInProduction = base.GetCurrentItemInProduction();
         if ((currentItemInProduction == null) || (currentItemInProduction.Blueprint.ProgressBarSoundCue == null))
         {
             nullable = null;
             this.m_soundEmitter.PlaySingleSound(this.ActionSound, false, false, false, nullable);
         }
         else
         {
             nullable = null;
             this.m_soundEmitter.PlaySingleSound(MySoundPair.GetCueId(currentItemInProduction.Blueprint.ProgressBarSoundCue), false, false, nullable);
         }
     }
 }
Exemple #2
0
 public override void UpdateCurrentItemStatus(float statusDelta)
 {
     if (base.IsProducing)
     {
         MyCraftingComponentBase.MyBlueprintToProduce itemToProduce = base.GetItemToProduce(base.m_currentItem);
         if (itemToProduce != null)
         {
             MyBlueprintDefinitionBase blueprint = itemToProduce.Blueprint;
             base.m_currentItemStatus = Math.Min((float)1f, (float)(base.m_currentItemStatus + ((statusDelta * base.m_craftingSpeedMultiplier) / (blueprint.BaseProductionTimeInSeconds * 1000f))));
         }
     }
 }