public static string GetLoadAttributeCode(this VFXData data, VFXAttribute attribute, string name, string index) { var r = new VFXShaderWriter(); r.WriteVariable( attribute.type, name, data.GetLoadAttributeCode(attribute, VFXAttributeLocation.Current)); var result = r.builder.ToString().Replace("(index *", $"({index} *"); return(result); }
internal static string CheckAlive(VFXData data) { var hasLifetime = data?.IsCurrentAttributeWritten(VFXAttribute.Alive) == true; if (hasLifetime) { return($@"{data.GetLoadAttributeCode(VFXAttribute.Alive, "isAlive", "index")} if (!isAlive) return; "); } return(""); }