示例#1
0
 public void UpdateNeededRenderers()
 {
     for (int i = 0; i < this._requiredIngredients.Count; i++)
     {
         Craft_Structure.BuildIngredients buildIngredients = this._requiredIngredients[i];
         ReceipeIngredient receipeIngredient = this._presentIngredients[i];
         buildIngredients.SetBuilt(receipeIngredient._amount);
     }
 }
示例#2
0
 public void Initialize()
 {
     if (!this._initialized)
     {
         if (this._presentIngredients == null)
         {
             this._presentIngredients = new ReceipeIngredient[this._requiredIngredients.Count];
         }
         if (this._presentIngredients.Length != this._requiredIngredients.Count)
         {
             this._presentIngredients = new ReceipeIngredient[this._requiredIngredients.Count];
         }
         for (int i = 0; i < this._requiredIngredients.Count; i++)
         {
             Craft_Structure.BuildIngredients buildIngredients = this._requiredIngredients[i];
             if (this._presentIngredients[i] == null)
             {
                 this._presentIngredients[i] = new ReceipeIngredient
                 {
                     _itemID = buildIngredients._itemID,
                     _amount = 0
                 };
             }
             ReceipeIngredient receipeIngredient = this._presentIngredients[i];
             int amount = buildIngredients._amount - receipeIngredient._amount;
             BuildMission.AddNeededToBuildMission(buildIngredients._itemID, amount, true);
             buildIngredients.SetBuilt(receipeIngredient._amount);
         }
         this._initialized = true;
         if (BoltNetwork.isRunning)
         {
             base.gameObject.AddComponent <CoopConstruction>();
             if (BoltNetwork.isServer && base.entity.isAttached)
             {
                 this.UpdateNetworkIngredients();
             }
         }
         if (!BoltNetwork.isClient)
         {
             this.CheckNeeded();
         }
     }
 }