How to use the mask

A mask is like the name of a display location.
When you add an item, existing items with the same mask are hidden.
This is useful for switching the display of items by location.

How to use

  1. Specify the default item and mask.
    If additional items have the same mask, the default item is not displayed.
  2. Specify additional items and masks.
    Additional items are always displayed.

Use from script

An example using a mask.
  1. using UnityEngine;
  2. using QCostume;

  3. public class Example : MonoBehaviour
  4. {
  5.     public CostumeBuilder builder;
  6.     public GameObject hair;
  7.     public GameObject tops;
  8.     public GameObject bottoms;
  9.     public GameObject dress;
  10.     void Start()
  11.     {
  12.         // Add default items.
  13.        builder.defaultItems.Add(new CostumeItem(hair, "HAIR"));
  14.         builder.defaultItems.Add(new CostumeItem(tops, "TOPS"));
  15.         builder.defaultItems.Add(new CostumeItem(bottoms, "BOTTOMS"));

  16.         // Add items.
  17.         //   Overrides TOPS and BOTTOMS masks.
  18.         //   The tops and bottoms object will not be displayed.
  19.         builder.Add(dress, "TOPS, BOTTOMS");

  20.         // Build items.
  21.         builder.Build();
  22.     }
  23. }