|
|
|
|
|
|
[SerializeField] |
|
|
|
private string m_SerializedSubGraph = string.Empty; |
|
|
|
|
|
|
|
[NonSerialized] |
|
|
|
MaterialSubGraphAsset m_SubGraph; |
|
|
|
|
|
|
|
[Serializable] |
|
|
|
private class SubGraphHelper |
|
|
|
{ |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#if UNITY_EDITOR
|
|
|
|
[ObjectControl("")] |
|
|
|
public MaterialSubGraphAsset subGraphAsset |
|
|
|
{ |
|
|
|
get |
|
|
|
|
|
|
|
|
|
|
var helper = new SubGraphHelper(); |
|
|
|
EditorJsonUtility.FromJsonOverwrite(m_SerializedSubGraph, helper); |
|
|
|
return helper.subGraph; |
|
|
|
if (m_SubGraph == null) |
|
|
|
{ |
|
|
|
var helper = new SubGraphHelper(); |
|
|
|
EditorJsonUtility.FromJsonOverwrite(m_SerializedSubGraph, helper); |
|
|
|
m_SubGraph = helper.subGraph; |
|
|
|
} |
|
|
|
|
|
|
|
return m_SubGraph; |
|
|
|
} |
|
|
|
set |
|
|
|
{ |
|
|
|
|
|
|
var helper = new SubGraphHelper(); |
|
|
|
helper.subGraph = value; |
|
|
|
m_SerializedSubGraph = EditorJsonUtility.ToJson(helper, true); |
|
|
|
m_SubGraph = null; |
|
|
|
#else
|
|
|
|
public MaterialSubGraphAsset subGraphAsset {get; set; } |
|
|
|
#endif
|
|
|
|
|
|
|
|
public INode outputNode |
|
|
|
{ |
|
|
|
|
|
|
var validNames = new List<int>(); |
|
|
|
if (referencedGraph == null) |
|
|
|
{ |
|
|
|
RemoveSlotsNameNotMatching(validNames); |
|
|
|
RemoveSlotsNameNotMatching(validNames, true); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|