Skip to content

Commit

Permalink
*Update test data
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulDemeulenaere committed Mar 31, 2021
1 parent 3ac5fde commit 741d304
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.VFX;
Expand All @@ -21,13 +22,17 @@ public override IEnumerable<Type> validTypes
{
get
{
//TODOPAUL : filter only ones declared with a flag
return VFXLibrary.GetSlotsType();
foreach (var type in VFXLibrary.GetSlotsType())
{
var typeAttribute = type.GetCustomAttributes(typeof(VFXTypeAttribute), true).FirstOrDefault() as VFXTypeAttribute;
if (typeAttribute != null && typeAttribute.flags.HasFlag(VFXTypeAttribute.Flags.GraphicsBuffer))
yield return type;
}
}
}


protected override Type defaultValueType => null;
protected override Type defaultValueType => validTypes.FirstOrDefault();

override public string name { get { return "Sample Graphics Buffer"; } }

Expand Down
15 changes: 14 additions & 1 deletion com.unity.visualeffectgraph/Editor/Types/VFXTypes.cs
Expand Up @@ -10,7 +10,20 @@ namespace UnityEditor.VFX
//TODOPAUL : Move to runtime, document & add filter for graphics buffer usage
[AttributeUsage(AttributeTargets.Struct)]
public class VFXTypeAttribute : Attribute
{}
{
[Flags]
public enum Flags
{
Default,
GraphicsBuffer
}
public VFXTypeAttribute(Flags flags = Flags.Default)
{
this.flags = flags;
}

public Flags flags { get; private set; }
}

enum SpaceableType
{
Expand Down

0 comments on commit 741d304

Please sign in to comment.