mathe/Library/PackageCache/com.unity.shadergraph@14.0.8/Editor/Generation/Contexts/TargetFieldContext.cs

30 lines
1.2 KiB
C#
Raw Normal View History

2024-09-20 20:30:10 +02:00
using System.Collections.Generic;
namespace UnityEditor.ShaderGraph
{
[GenerationAPI]
internal class TargetFieldContext
{
public List<ConditionalField> conditionalFields { get; private set; }
public PassDescriptor pass { get; private set; }
public List<(BlockFieldDescriptor descriptor, bool isDefaultValue)> blocks { get; private set; }
public List<BlockFieldDescriptor> connectedBlocks { get; private set; }
public bool hasDotsProperties { get; private set; }
// NOTE: active blocks (and connectedBlocks) do not include temporarily added default blocks
public TargetFieldContext(PassDescriptor pass, List<(BlockFieldDescriptor descriptor, bool isDefaultValue)> activeBlocks, List<BlockFieldDescriptor> connectedBlocks, bool hasDotsProperties)
{
conditionalFields = new List<ConditionalField>();
this.pass = pass;
this.blocks = activeBlocks;
this.connectedBlocks = connectedBlocks;
this.hasDotsProperties = hasDotsProperties;
}
public void AddField(FieldDescriptor field, bool conditional = true)
{
conditionalFields.Add(new ConditionalField(field, conditional));
}
}
}