示例#1
0
文件: CASParts.cs 项目: yakoder/NRaas
            public static void CopyGeneticParts(SimBuilder builder, SimOutfit sourceOutfit)
            {
                builder.RemoveParts(new List <BodyTypes>(CASParts.GeneticBodyTypes).ToArray());

                foreach (CASPart part in sourceOutfit.Parts)
                {
                    if (!CASParts.GeneticBodyTypes.Contains(part.BodyType))
                    {
                        continue;
                    }

                    if ((part.Age & builder.Age) != builder.Age)
                    {
                        continue;
                    }

                    if ((part.Gender & builder.Gender) != builder.Gender)
                    {
                        continue;
                    }

                    new PartPreset(part, sourceOutfit).Apply(builder);
                }

                builder.SetSecondaryNormalMapWeights(sourceOutfit.SecondaryNormalMapWeights);

                builder.FurMap          = sourceOutfit.FurMap;
                builder.NumCurls        = sourceOutfit.NumCurls;
                builder.CurlPixelRadius = sourceOutfit.CurlPixelRadius;
            }
示例#2
0
        public void Apply(SimBuilder builder, bool applyHairColor, IEnumerable<BodyTypes> argTypes, IEnumerable<BodyTypes> argNotTypes)
        {
            List<BodyTypes> types = null;
            if (argTypes != null)
            {
                types = new List<BodyTypes>(argTypes);
            }

            List<BodyTypes> notTypes = null;
            if (argNotTypes != null)
            {
                notTypes = new List<BodyTypes>(argNotTypes);
            }

            if ((types == null) || (types.Count == 0))
            {
                types = null;
            }
            else if (notTypes != null)
            {
                foreach(BodyTypes type in types)
                {
                    notTypes.Remove(type);
                }
            }

            ColorStore store = mStore;
            if (!applyHairColor)
            {
                store = new ColorStore(builder);
            }

            if (types != null)
            {
                if ((types.Contains(BodyTypes.UpperBody)) || (types.Contains(BodyTypes.LowerBody)))
                {
                    builder.RemoveParts(new BodyTypes[] { BodyTypes.FullBody });
                }

                if (types.Contains(BodyTypes.FullBody))
                {
                    builder.RemoveParts(new BodyTypes[] { BodyTypes.UpperBody, BodyTypes.LowerBody });
                }

                builder.RemoveParts(types.ToArray());
            }
            else 
            {
                List<BodyTypes> allTypes = new List<BodyTypes>(CASParts.AllTypes);

                if (notTypes != null)
                {
                    foreach(BodyTypes type in notTypes)
                    {
                        allTypes.Remove(type);
                    }
                }

                builder.RemoveParts(allTypes.ToArray());
            }

            foreach (SavedPart part in mParts)
            {
                if (types != null)
                {
                    if (!types.Contains(part.mPart.BodyType)) continue;
                }

                if (notTypes != null)
                {
                    if (notTypes.Contains(part.mPart.BodyType)) continue;
                }

                builder.AddPart(part.mPart);

                if ((part.mPreset != null) && CASUtils.ApplyPresetToPart(builder, part.mPart, part.mPreset))
                {
                    builder.SetPartPreset(part.mPart.Key, null, part.mPreset);
                }
            }

            store.Apply(builder);
        }
示例#3
0
            public static void CopyGeneticParts(SimBuilder builder, SimOutfit sourceOutfit)
            {
                builder.RemoveParts(new List<BodyTypes>(CASParts.GeneticBodyTypes).ToArray());

                foreach (CASPart part in sourceOutfit.Parts)
                {
                    if (!CASParts.GeneticBodyTypes.Contains(part.BodyType)) continue;

                    if ((part.Age & builder.Age) != builder.Age) continue;

                    if ((part.Gender & builder.Gender) != builder.Gender) continue;

                    new PartPreset(part, sourceOutfit).Apply(builder);
                }

                builder.SetSecondaryNormalMapWeights(sourceOutfit.SecondaryNormalMapWeights);

                builder.FurMap = sourceOutfit.FurMap;
                builder.NumCurls = sourceOutfit.NumCurls;
                builder.CurlPixelRadius = sourceOutfit.CurlPixelRadius;
            }
示例#4
0
        public void Apply(SimBuilder builder, bool applyHairColor, IEnumerable <BodyTypes> argTypes, IEnumerable <BodyTypes> argNotTypes)
        {
            List <BodyTypes> types = null;

            if (argTypes != null)
            {
                types = new List <BodyTypes>(argTypes);
            }

            List <BodyTypes> notTypes = null;

            if (argNotTypes != null)
            {
                notTypes = new List <BodyTypes>(argNotTypes);
            }

            if ((types == null) || (types.Count == 0))
            {
                types = null;
            }
            else if (notTypes != null)
            {
                foreach (BodyTypes type in types)
                {
                    notTypes.Remove(type);
                }
            }

            ColorStore store = mStore;

            if (!applyHairColor)
            {
                store = new ColorStore(builder);
            }

            if (types != null)
            {
                if ((types.Contains(BodyTypes.UpperBody)) || (types.Contains(BodyTypes.LowerBody)))
                {
                    builder.RemoveParts(new BodyTypes[] { BodyTypes.FullBody });
                }

                if (types.Contains(BodyTypes.FullBody))
                {
                    builder.RemoveParts(new BodyTypes[] { BodyTypes.UpperBody, BodyTypes.LowerBody });
                }

                builder.RemoveParts(types.ToArray());
            }
            else
            {
                List <BodyTypes> allTypes = new List <BodyTypes>(CASParts.AllTypes);

                if (notTypes != null)
                {
                    foreach (BodyTypes type in notTypes)
                    {
                        allTypes.Remove(type);
                    }
                }

                builder.RemoveParts(allTypes.ToArray());
            }

            foreach (SavedPart part in mParts)
            {
                if (types != null)
                {
                    if (!types.Contains(part.mPart.BodyType))
                    {
                        continue;
                    }
                }

                if (notTypes != null)
                {
                    if (notTypes.Contains(part.mPart.BodyType))
                    {
                        continue;
                    }
                }

                builder.AddPart(part.mPart);

                if ((part.mPreset != null) && CASUtils.ApplyPresetToPart(builder, part.mPart, part.mPreset))
                {
                    builder.SetPartPreset(part.mPart.Key, null, part.mPreset);
                }
            }

            store.Apply(builder);
        }