예제 #1
0
 public void SaveExternalCustomisations()
 {
     foreach (var Customisation in OpenCustomisation)
     {
         var newExternalCustomisation = new ExternalCustomisation();
         newExternalCustomisation.Key             = Customisation.thisCustomisations.name;
         newExternalCustomisation.SerialisedValue = Customisation.Serialise();
         ExternalCustomisationStorage.Add(newExternalCustomisation);
     }
 }
예제 #2
0
        private void SetAllDropdowns()
        {
            if (currentCharacter.SerialisedBodyPartCustom == null)
            {
                currentCharacter.SerialisedBodyPartCustom = new List <CustomisationStorage>();
            }

            if (currentCharacter.SerialisedExternalCustom == null)
            {
                currentCharacter.SerialisedExternalCustom = new List <ExternalCustomisation>();
            }

            bodyPartCustomisationStorage = new List <CustomisationStorage>(currentCharacter.SerialisedBodyPartCustom);
            ExternalCustomisationStorage = new List <ExternalCustomisation>(currentCharacter.SerialisedExternalCustom);
            if (bodyPartCustomisationStorage == null)
            {
                bodyPartCustomisationStorage = new List <CustomisationStorage>();
            }

            if (ExternalCustomisationStorage == null)
            {
                ExternalCustomisationStorage = new List <ExternalCustomisation>();
            }


            foreach (var Customisation in OpenCustomisation)
            {
                ExternalCustomisation MatchedCustomisation = null;
                foreach (var customisation in ExternalCustomisationStorage)
                {
                    if (customisation.Key == Customisation.thisCustomisations.name)
                    {
                        MatchedCustomisation = customisation;
                    }
                }

                if (MatchedCustomisation != null)
                {
                    Customisation.SetDropdownValue(MatchedCustomisation.SerialisedValue);
                }
            }


            SetDropDownBody(ThisSetRace.Base.Torso);
            SetDropDownBody(ThisSetRace.Base.Head);
            SetDropDownBody(ThisSetRace.Base.ArmLeft);
            SetDropDownBody(ThisSetRace.Base.ArmRight);
            SetDropDownBody(ThisSetRace.Base.LegLeft);
            SetDropDownBody(ThisSetRace.Base.LegRight);
        }