Firstborn/Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Generation/SubTarget.cs

39 lines
1.4 KiB
C#
Raw Normal View History

2023-03-28 13:24:16 -04:00
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UIElements;
using UnityEditor.ShaderGraph.Serialization;
namespace UnityEditor.ShaderGraph
{
[Serializable, GenerationAPI] // TODO: Public
internal abstract class SubTarget : JsonObject
{
internal abstract Type targetType { get; }
internal Target target { get; set; }
public string displayName { get; set; }
public bool isHidden { get; set; }
public abstract bool IsActive();
public abstract void Setup(ref TargetSetupContext context);
public abstract void GetFields(ref TargetFieldContext context);
public abstract void GetActiveBlocks(ref TargetActiveBlockContext context);
public abstract void GetPropertiesGUI(ref TargetPropertyGUIContext context, Action onChange, Action<String> registerUndo);
public virtual void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) { }
public virtual void ProcessPreviewMaterial(Material material) { }
public virtual object saveContext => null;
}
[GenerationAPI] // TODO: Public
internal abstract class SubTarget<T> : SubTarget where T : Target
{
internal override Type targetType => typeof(T);
public new T target
{
get => base.target as T;
set => base.target = value;
}
}
}