浏览代码

Extracted abstract base class from MaterialGraphInspector

/main
Peter Bay Bastian 8 年前
当前提交
2eace1c5
共有 7 个文件被更改,包括 49 次插入14 次删除
  1. 23
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphInspector.cs
  2. 12
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphInspector.cs.meta
  3. 9
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/GraphInspectors.meta
  4. 19
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/GraphInspectors/MaterialGraphInspector.cs
  5. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphInspector.cs
  6. 0
      /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/GraphInspectors/MaterialGraphInspector.cs.meta

23
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphInspector.cs


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()

12
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphInspector.cs.meta


fileFormatVersion: 2
guid: 1f5db4792e1ba1a489e024a51ede81e2
timeCreated: 1483621204
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

9
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/GraphInspectors.meta


fileFormatVersion: 2
guid: 56bd8d0f45aa3394cb70153872cf053b
folderAsset: yes
timeCreated: 1483621325
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

19
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/GraphInspectors/MaterialGraphInspector.cs


using UnityEngine.MaterialGraph;
namespace UnityEditor.MaterialGraph.Drawing
{
[CustomEditor(typeof(MaterialGraphAsset))]
public class MaterialGraphInspector : AbstractMaterialGraphInspector
{
private UnityEngine.MaterialGraph.MaterialGraph materialGraph
{
get { return m_GraphAsset.graph as UnityEngine.MaterialGraph.MaterialGraph; }
}
public override void OnEnable()
{
base.OnEnable();
previewNode = materialGraph.masterNode as AbstractMaterialNode;
}
}
}

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphInspector.cs → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/AbstractMaterialGraphInspector.cs

/MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/MaterialGraphInspector.cs.meta → /MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/GraphInspectors/MaterialGraphInspector.cs.meta

正在加载...
取消
保存