A game about forced loneliness, made by TACStudios
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.Rendering;
5using UnityEngine.UIElements;
6using UnityEditor.ShaderGraph.Serialization;
7
8namespace UnityEditor.ShaderGraph
9{
10 [Serializable, GenerationAPI] // TODO: Public
11 internal abstract class Target : JsonObject
12 {
13 public string displayName { get; set; }
14 public bool isHidden { get; set; }
15 internal virtual bool ignoreCustomInterpolators => true;
16 internal virtual int padCustomInterpolatorLimit => 4;
17 internal virtual bool prefersSpritePreview => false;
18 public abstract bool IsActive();
19 public abstract void Setup(ref TargetSetupContext context);
20 public abstract void GetFields(ref TargetFieldContext context);
21 public abstract void GetActiveBlocks(ref TargetActiveBlockContext context);
22 public abstract void GetPropertiesGUI(ref TargetPropertyGUIContext context, Action onChange, Action<string> registerUndo);
23 public virtual void CollectShaderProperties(PropertyCollector collector, GenerationMode generationMode) { }
24 public virtual void ProcessPreviewMaterial(Material material) { }
25 public virtual object saveContext => null;
26 public virtual bool IsNodeAllowedByTarget(Type nodeType)
27 {
28 NeverAllowedByTargetAttribute never = NodeClassCache.GetAttributeOnNodeType<NeverAllowedByTargetAttribute>(nodeType);
29 return never == null;
30 }
31
32 public virtual bool DerivativeModificationCallback(
33 out string dstGraphFunctions,
34 out string dstGraphPixel,
35 out bool[] adjustedUvDerivs,
36 string primaryShaderName,
37 string passName,
38 string propStr,
39 string surfaceDescStr,
40 string graphFuncStr,
41 string graphPixelStr,
42 List<string> customFuncs,
43 bool applyEmulatedDerivatives)
44 {
45 dstGraphFunctions = "";
46 dstGraphPixel = "";
47 adjustedUvDerivs = new bool[4];
48 return false;
49 }
50
51 // think this is not called by anyone anymore, leaving it to avoid changing client code
52 public abstract bool WorksWithSRP(RenderPipelineAsset scriptableRenderPipeline);
53 }
54}