本文整理汇总了C#中SimDescription.RemoveOutfit方法的典型用法代码示例。如果您正苦于以下问题:C# SimDescription.RemoveOutfit方法的具体用法?C# SimDescription.RemoveOutfit怎么用?C# SimDescription.RemoveOutfit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimDescription
的用法示例。
在下文中一共展示了SimDescription.RemoveOutfit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
protected override bool Run(SimDescription me, bool singleSelection)
{
if (!ApplyAll)
{
List<OutfitCategories> categories = new List<OutfitCategories>();
foreach (OutfitCategories category in Enum.GetValues(typeof(OutfitCategories)))
{
if (category == OutfitCategories.Special) continue;
categories.Add(category);
}
List<Item> allOptions = GetOptions(me, categories);
CommonSelection<Item>.Results choices = new CommonSelection<Item>(Name, me.FullName, allOptions).SelectMultiple();
if ((choices == null) || (choices.Count == 0)) return false;
mOutfits.Clear();
mOutfits.AddRange(choices);
}
CASParts.Key currentKey = new CASParts.Key(me.CreatedSim);
// Remove them in reverse to ensure that removing earlier indices doesn't alter the index of later ones
for(int i=mOutfits.Count-1; i>=0; i--)
{
Item item = mOutfits[i];
if (item.Value == currentKey) continue;
me.RemoveOutfit(item.Category, item.Index, true);
}
return true;
}