-
Notifications
You must be signed in to change notification settings - Fork 0
Creating Variants
To add variants to your part, you first should import V-SwiFT's mixins by doing
@use "VSwift:*";At the top of any patch file where you want to add variants
First you want to set up the part switch module on your part by doing
:parts ... {
@include part-switch() {
// This will be where all the following goes
}
}Inside the block you created, you can add variant sets by doing +[variant set id]
+SomeVariantSet {
// You can optionally add a localization key, by default it defaults to the variant set id
VariantSetLocalizationKey: OptionalLocalizationKey;
// This is where we will add variants
}Inside the variant set you created, you can add a variant by doing +[variant id]
+SomeVariant {
// You can optionally add a localization key, by default it defaults to the variant id
VariantLocalizationKey: OptionalLocalizationKey;
// This is where we will add transformers
}Inside variants are the transformers that set up this variant, they can be added quite easily by doing +TransformerType
+SomeTransformer {
// All the transformer parameters go here
}The 2 implemented transformers currently are TransformActivator and MaterialSwapper
This transformer takes one "parameter" which is Transforms, which is a list of transform names to activate
+TransformActivator {
Transforms: [...];
}Note with the transform activator: All transforms you will be wanting to "activate" should be deactivated by default in unity
This transformer takes one "parameter" which is Swaps, which is a dictionary of material swaps of from,to
+MaterialSwapper {
Swaps: {
from: to
};
}In the from it ignores any (Instance), and on the to it has to be of a special form with a protocol:// in front of it, the only protocol supported
at the moment is addressables which has an addressables key after the addressables://