You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.3 KiB
35 lines
1.3 KiB
using System.Collections.Generic;
|
|
|
|
namespace UnityEditor.VFX
|
|
{
|
|
class VFXStripTopologyProvider : VariantProvider
|
|
{
|
|
public override IEnumerable<Variant> GetVariants()
|
|
{
|
|
yield return new VFXComposedParticleOutputVariant(
|
|
"Output ParticleStrip".AppendLabel("ShaderGraph").AppendLabel("Quad"),
|
|
VFXLibraryStringHelper.Separator("Output Strip", 3),
|
|
typeof(VFXComposedParticleStripOutput),
|
|
() => new ParticleTopologyQuadStrip());
|
|
}
|
|
}
|
|
|
|
[VFXInfo(variantProvider = typeof(VFXStripTopologyProvider), synonyms = new []{ "Trail", "Ribbon" })]
|
|
sealed class VFXComposedParticleStripOutput : VFXAbstractComposedParticleOutput
|
|
{
|
|
VFXComposedParticleStripOutput() : base(true) { }
|
|
|
|
internal override void GenerateErrors(VFXErrorReporter report)
|
|
{
|
|
base.GenerateErrors(report);
|
|
foreach (var attributeInfo in GetAttributesInfos())
|
|
{
|
|
if (attributeInfo.mode.HasFlag(VFXAttributeMode.Write) && attributeInfo.attrib.Equals(VFXAttribute.Position))
|
|
{
|
|
report.RegisterError("WritePositionInStrip", VFXErrorType.Warning, VFXQuadStripOutput.WriteToPositionMessage, this);
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|