using System; using System.Collections.Generic; using System.Linq; using UnityEditor.VFX.Block; using UnityEngine; using UnityEngine.VFX; namespace UnityEditor.VFX { [VFXInfo(name = "Output Particle Cube", category = "Output", experimental = true)] class VFXBasicCubeOutput : VFXAbstractParticleOutput { public override string name { get { return "Output Particle Cube"; } } public override string codeGeneratorTemplate { get { return RenderPipeTemplate("VFXParticleBasicCube"); } } public override VFXTaskType taskType { get { return VFXTaskType.ParticleHexahedronOutput; } } public override bool supportsUV { get { return true; } } public override bool implementsMotionVector { get { return true; } } public override CullMode defaultCullMode { get { return CullMode.Back; } } protected override IEnumerable CollectGPUExpressions(IEnumerable slotExpressions) { foreach (var exp in base.CollectGPUExpressions(slotExpressions)) yield return exp; yield return slotExpressions.First(o => o.name == "mainTexture"); } protected override IEnumerable inputProperties { get { foreach (var input in base.inputProperties) yield return input; yield return new VFXPropertyWithValue(new VFXProperty(GetFlipbookType(), "mainTexture", new TooltipAttribute("Specifies the base color (RGB) and opacity (A) of the particle.")), (usesFlipbook ? null : VFXResources.defaultResources.particleTexture)); } } protected override IEnumerable filteredOutSettings { get { foreach (var setting in base.filteredOutSettings) yield return setting; yield return nameof(colorMapping); yield return nameof(enableRayTracing); } } protected override IEnumerable untransferableSettings { get { foreach (var setting in base.untransferableSettings) { yield return setting; } yield return nameof(enableRayTracing); } } } }