You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEditor.ShaderGraph.Drawing;
|
|
using UnityEditor.ShaderGraph.Serialization;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
|
|
namespace UnityEditor.ShaderGraph
|
|
{
|
|
|
|
[Serializable]
|
|
internal abstract class AbstractShaderGraphDataExtension : JsonObject
|
|
{
|
|
internal virtual int paddingIdentationFactor => 15;
|
|
|
|
internal abstract string displayName { get; }
|
|
|
|
internal abstract void OnPropertiesGUI(VisualElement context, Action onChange, Action<string> registerUndo, GraphData owner);
|
|
|
|
internal static List<AbstractShaderGraphDataExtension> ValidExtensions()
|
|
{
|
|
var result = new List<AbstractShaderGraphDataExtension>();
|
|
foreach (var type in TypeCache.GetTypesDerivedFrom(typeof(AbstractShaderGraphDataExtension)))
|
|
{
|
|
if (type.IsGenericType || type == typeof(MultiJsonInternal.UnknownGraphDataExtension))
|
|
continue;
|
|
|
|
var subData = (AbstractShaderGraphDataExtension)Activator.CreateInstance(type);
|
|
result.Add(subData);
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
}
|