コード例 #1
0
 private void OnDeserialized()
 {
     this.CheckInit();
     if (this._availableClothingOutfits.Count > this._availableClothingOutfitCount)
     {
         this._availableClothingOutfits.RemoveRange(this._availableClothingOutfitCount, this._availableClothingOutfits.Count - this._availableClothingOutfitCount);
     }
     if (this._wornClothingItems.Count > this._wornClothingItemsCount)
     {
         this._wornClothingItems.RemoveRange(this._wornClothingItemsCount, this._wornClothingItems.Count - this._wornClothingItemsCount);
     }
     if (this._availableClothingOutfits.Count == 0 && this._wornClothingItems.Count == 0)
     {
         if (!BoltNetwork.isRunning)
         {
             this.AddClothingOutfit(new List <int>
             {
                 4,
                 24
             }, true);
         }
         else
         {
             this.AddClothingOutfit(ClothingItemDatabase.GetRandomOutfit(LocalPlayer.Stats.PlayerVariation == 0), true);
         }
     }
     this.RefreshVisibleClothing();
 }
コード例 #2
0
ファイル: ClothingPickup.cs プロジェクト: DevZhav/The-Forest
 private void Update()
 {
     if (TheForest.Utils.Input.GetButtonAfterDelay("Take", 0.5f, false))
     {
         this.RefreshBoltState();
         List <int> list = (from id in this._presetOutfitItemIds
                            where id > 0
                            select id).ToList <int>();
         List <int> ids = (list != null && list.Count != 0) ? list : ClothingItemDatabase.GetRandomOutfit(LocalPlayer.Stats.PlayerVariation == 0);
         if (LocalPlayer.Clothing.AddClothingOutfit(ids, true))
         {
             Scene.HudGui.ToggleGotClothingOutfitHud();
             LocalPlayer.Clothing.RefreshVisibleClothing();
             LocalPlayer.Stats.CheckArmsStart();
             if (BoltNetwork.isRunning && !base.entity.isOwner && !this._clientOnlyTake)
             {
                 this.SendBoltTaken();
             }
             else
             {
                 this.DoDestroy();
             }
         }
         else
         {
             Scene.HudGui.ToggleFullClothingOutfitCapacityHud();
         }
     }
 }