|
|
|
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using UnityEditor.Graphing.Drawing; |
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.Graphing; |
|
|
|
|
|
|
{ |
|
|
|
[CustomEditor(typeof(MaterialGraphAsset))] |
|
|
|
public class MaterialGraphInspector : AbstractGraphInspector |
|
|
|
public abstract class AbstractMaterialGraphInspector : AbstractGraphInspector |
|
|
|
private GUIContent m_Title = new GUIContent(); |
|
|
|
protected GUIContent m_Title = new GUIContent(); |
|
|
|
|
|
|
|
private NodePreviewDrawData m_NodePreviewPresenter; |
|
|
|
private AbstractMaterialNode previewNode |
|
|
|
protected AbstractMaterialNode previewNode |
|
|
|
{ |
|
|
|
get { return m_PreviewNode; } |
|
|
|
set |
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private NodePreviewDrawData m_NodePreviewPresenter; |
|
|
|
|
|
|
|
private UnityEngine.MaterialGraph.MaterialGraph materialGraph |
|
|
|
protected override void AddTypeMappings(Action<Type, Type> map) |
|
|
|
get { return m_GraphAsset.graph as UnityEngine.MaterialGraph.MaterialGraph; } |
|
|
|
map(typeof(AbstractSurfaceMasterNode), typeof(SurfaceMasterNodeInspector)); |
|
|
|
} |
|
|
|
|
|
|
|
private void OnPreviewNodeModified(INode node, ModificationScope scope) |
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
protected override void AddTypeMappings(Action<Type, Type> map) |
|
|
|
{ |
|
|
|
map(typeof(AbstractSurfaceMasterNode), typeof(SurfaceMasterNodeInspector)); |
|
|
|
} |
|
|
|
|
|
|
|
previewNode = materialGraph.masterNode as AbstractMaterialNode; |
|
|
|
previewNode = null; |
|
|
|
} |
|
|
|
|
|
|
|
public override bool HasPreviewGUI() |
|
|
|