ClothingContainerclass

Holds a collection of clothing items. Won't let you add items that aren't compatible.

objectClothingContainer
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.ClothingContainer

Constructors1

Showing 1 constructors

Methods19

Showing 19 methods

public void Apply(Sandbox.SkinnedModelRenderer body)PUBLIC

Dress a skinned model renderer with an outfit. Doesn't download missing clothing.

ParameterTypeDescription
bodySkinnedModelRenderer
Returns:void

public System.Threading.Tasks.Task ApplyAsync(Sandbox.SkinnedModelRenderer body, System.Threading.CancellationToken token)PUBLIC

Dresses a skinned model with an outfit. Will apply all the clothes it can immediately, then download any missing clothing.

ParameterTypeDescription
bodySkinnedModelRenderer
tokenCancellationToken
Returns:Task

public static Sandbox.ClothingContainer CreateFromConnection(Sandbox.Connection connection, bool removeUnowned = True)PUBLICSTATIC

Create the container from a connection's avatar, filtered to only items they are verified to own.

ParameterTypeDescription
connectionConnection
removeUnowned = Truebool

public static Sandbox.ClothingContainer CreateFromJson(string json)PUBLICSTATIC

Create the container from json definitions

ParameterTypeDescription
jsonstring

public static Sandbox.ClothingContainer CreateFromLocalUser()PUBLICSTATIC

Create the container from the local user's setup, stripped of any unowned items.

public void Deserialize(string json)PUBLIC

Deserialize from Json

ParameterTypeDescription
jsonstring
Returns:void

public bool Has(Sandbox.Clothing clothing)PUBLIC

Returns true if we have this clothing item

ParameterTypeDescription
clothingClothing
Returns:bool

public void Normalize()PUBLIC

Restrict things like Height to their sensible limits

Returns:void

public string Serialize()PUBLIC

Serialize to Json

Returns:string

public void Toggle(Sandbox.Clothing clothing)PUBLIC

Add a clothing item if we don't already contain it, else remove it

ParameterTypeDescription
clothingClothing
Returns:void

Properties5

Showing 5 properties

public float Sandbox.ClothingContainer.Age { get; set; }PUBLICGETSET

The avatar's age. Default is 0.0f. We'll pick a skin based on this.

Returns:float

public string Sandbox.ClothingContainer.DisplayName { get; set; }PUBLICGETSET

A user set name for this setup

Returns:string

public float Sandbox.ClothingContainer.Height { get; set; }PUBLICGETSET

The avatar's height. Default is 0.5f.

Returns:float

public bool Sandbox.ClothingContainer.PrefersHuman { get; set; }PUBLICGETSET

If true, this avatar prefers to use a human model when possible

Returns:bool

public float Sandbox.ClothingContainer.Tint { get; set; }PUBLICGETSET

For the citizen the skin color is dynamic, based on a gradient. This is 0-1.

Returns:float

On this page

Constructorspublic ClothingContainer()Methodspublic Sandbox.ClothingContainer.ClothingEntry Add(Sandbox.Clothing clothing)public System.Void Add(Sandbox.ClothingContainer.ClothingEntry clothing)public System.Void AddRange(System.Collections.Generic.IEnumerable`1<Sandbox.ClothingContainer.ClothingEntry> clothing)public System.Void Apply(Sandbox.SkinnedModelRenderer body)public System.Threading.Tasks.Task ApplyAsync(Sandbox.SkinnedModelRenderer body, System.Threading.CancellationToken token)public static Sandbox.ClothingContainer CreateFromConnection(Sandbox.Connection connection, System.Boolean removeUnowned = True)public static Sandbox.ClothingContainer CreateFromJson(System.String json)public static Sandbox.ClothingContainer CreateFromLocalUser()public System.Void Deserialize(System.String json)public Sandbox.ClothingContainer.ClothingEntry FindEntry(Sandbox.Clothing clothing)public System.Collections.Generic.IEnumerable`1<System.ValueTuple`2<System.String,System.Int32>> GetBodyGroups()public System.Collections.Generic.IEnumerable`1<System.ValueTuple`2<System.String,System.Int32>> GetBodyGroups(System.Collections.Generic.IEnumerable`1<Sandbox.Clothing> items, Sandbox.Model model = null)public System.Boolean Has(Sandbox.Clothing clothing)public System.Void Normalize()public System.Void RemoveUnownedItems()public System.Void RemoveUnownedItems(Sandbox.Connection connection)public System.Void Reset(Sandbox.SkinnedModelRenderer body)public System.String Serialize()public System.Void Toggle(Sandbox.Clothing clothing)Propertiespublic System.Single Sandbox.ClothingContainer.Age { get; set; }public System.String Sandbox.ClothingContainer.DisplayName { get; set; }public System.Single Sandbox.ClothingContainer.Height { get; set; }public System.Boolean Sandbox.ClothingContainer.PrefersHuman { get; set; }public System.Single Sandbox.ClothingContainer.Tint { get; set; }Metadata