您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
36 行
925 B
36 行
925 B
using System;
|
|
using UnityEditor.Graphing.Drawing;
|
|
using UnityEngine.Graphing;
|
|
using UnityEngine.MaterialGraph;
|
|
|
|
namespace UnityEditor.MaterialGraph.Drawing
|
|
{
|
|
[Serializable]
|
|
public class MaterialNodeDrawData : NodeDrawData
|
|
{
|
|
public bool requiresTime
|
|
{
|
|
get { return node is IRequiresTime; }
|
|
}
|
|
|
|
protected MaterialNodeDrawData()
|
|
{}
|
|
|
|
public override void Initialize(INode inNode)
|
|
{
|
|
base.Initialize(inNode);
|
|
AddPreview(inNode);
|
|
}
|
|
|
|
private void AddPreview(INode inNode)
|
|
{
|
|
var materialNode = inNode as AbstractMaterialNode;
|
|
if (materialNode == null || !materialNode.hasPreview)
|
|
return;
|
|
|
|
var previewData = CreateInstance<NodePreviewDrawData>();
|
|
previewData.Initialize(materialNode);
|
|
m_Children.Add(previewData);
|
|
}
|
|
}
|
|
}
|