Files
Test/Library/PackageCache/com.unity.shadergraph@8b7e693cdbfe/Editor/Importers/ShaderGraphIndexerExtension.cs
T
2026-11-01 23:39:55 +02:00

27 lines
1.1 KiB
C#

using UnityEditor.Experimental.GraphView;
using UnityEditor.Search;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
static class ShaderGraphIndexerExtension
{
static void ShaderGraphIndexer(CustomObjectIndexerTarget context, ObjectIndexer indexer)
{
if (ShaderGraphTemplateHelper.TryGetTemplateStatic(context.id, out var template, out var dataBag))
{
GraphViewIndexerExtension.IndexCommonData<ShaderGraphImporter>(context, indexer, template);
GraphViewIndexerExtension.IndexCustomData<ShaderGraphImporter>(context, indexer, dataBag.GetCustomData($"{template.ToolKey}."));
}
}
[CustomObjectIndexer(typeof(ShaderGraphImporter), version = 2)]
internal static void ShaderGraphImporterIndexer(CustomObjectIndexerTarget context, ObjectIndexer indexer)
=> ShaderGraphIndexer(context, indexer);
[CustomObjectIndexer(typeof(Shader), version = 2)]
internal static void ShaderGraphShaderIndexer(CustomObjectIndexerTarget context, ObjectIndexer indexer)
=> ShaderGraphIndexer(context, indexer);
}
}