Skip to main content

LocalPlayerAdvertisingTrophy

A class in Root.Township, the global namespace.

Dresses a character dummy in a base body plus a set of advertised cosmetics, loaded through its own customization manager. Also runs in edit mode.

Constructors​

MemberWhat it is
LocalPlayerAdvertisingTrophy()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

6 private and internal fields
MemberWhat it is
private List<CosmeticDefinitionSku> advertisedCosmetics being shown off.
private bool bakeBtnEditor button for BakeModelDebug.
private List<CosmeticDefinitionSku> baseBodyBase body cosmetics put on first.
private PlayerCustomizationHandler handlerCustomization handler for the character dummy.
private PlayerCharacterCustomizationManager localManagerCustomization manager used for the dummy only.
private AddressableSession sessionAddressable session used to load the cosmetics.

Properties​

MemberWhat it is
int SortingOrder { get; }Build bake order. Never set, so 0.

Methods​

MemberWhat it is
void Bake(bool isSaving)Build bake step: runs the Android LOD fix.
async void BakeModel()Resets the dummy, starts a cosmetics session and adds the base body and advertised cosmetics.
void BakeModelDebug()Editor button that calls BakeModel.
void Clean()Empty build clean step.
9 private and internal methods
MemberWhat it is
private void AndroidLodFix()In the editor on Android only: drops the first LOD level when it has no skinned meshes and there are more than 3 levels.
private async Task ApplyPlayerCosmetics()Copies the local player's own cosmetics onto the dummy. Not called in this file.
private bool AreSameTypes<T>(T[] a, T[] b)True when two arrays have the same length and matching element types.
private void EndSession()Unpauses the dummy's cosmetic packer and stops the cosmetics session.
private async Task EnsureMinimumArgumentsPresent(IEnumerable<CosmeticDefinitionSku> list)Replaces each item's customization arguments with defaults when their types don't match the cosmetic.
private async Task EnsureSessionStarted()Creates the customization manager and addressable session if needed, attaches the dummy and clears its cosmetics.
private void OnDrawGizmos()Editor: names each listed item after its cosmetic, or Empty.
private void ResetDummy()Pauses and cleans the dummy's cosmetic packer and detaches it from its manager.
private void Start()Runs the Android LOD fix and builds the model.

Used in​

Members of other types that take, return or hold a LocalPlayerAdvertisingTrophy: