Example #1
0
        void UpdateClothes(EventClothesChanged eventClothesChanged)
        {
            lastKnownClothes.hasReloadedScene--;
            if (eventClothesChanged.CombinedWearables == null)
            {
                return;
            }
            bool clothesRemoved = CompareAndRemoveSelectedClothes(eventClothesChanged.CombinedWearables);

            if (clothesRemoved)
            {
                //update last known clothes (set to null)
                var field = typeof(LastKnownClothes).GetField(eventClothesChanged.CombinedWearables.clothingType.name);
                if (field == null)
                {
                    throw new Exception("can't find the clothing type field in last known clothes!");
                }

                field.SetValue(lastKnownClothes, null);
                return;
            }

            EnableOrDisableCategory(eventClothesChanged.CombinedWearables);

            DressBodyParts(eventClothesChanged.CombinedWearables);

            SetLastKnownItemOfType(eventClothesChanged.CombinedWearables);
        }
        void OnClothingChanged(EventClothesChanged eventClothesChanged)
        {
            var combinedWearable = eventClothesChanged.CombinedWearables;

            if (IsNewWearable(combinedWearable))
            {
                LegsClothingType(combinedWearable.clothingType);
                AddOrReplaceClothingType(combinedWearable);
            }

            if (requirements.Count == 0)
            {
                return;
            }
            CheckRequirements();
        }