浏览代码

Let master node to have 2D preview

/main
MingWai 8 年前
当前提交
b359c1c7
共有 3 个文件被更改,包括 13 次插入1 次删除
  1. 7
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs
  2. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Interfaces/IMasterNode.cs
  3. 5
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/AbstractMasterNode.cs

7
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Presenters/NodePreviewPresenter.cs


List<PropertyGenerator.TextureInfo> defaultTextures;
var resultShader = ((IMasterNode) m_Node).GetFullShader(GenerationMode.Preview, out defaultTextures);
m_GeneratedShaderMode = PreviewMode.Preview3D;
if (((IMasterNode)m_Node).has3DPreview())
{
m_GeneratedShaderMode = PreviewMode.Preview3D;
}
return resultShader;
}
return ShaderGenerator.GeneratePreviewShader(m_Node, out m_GeneratedShaderMode);

2
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Interfaces/IMasterNode.cs


string GetSubShader(GenerationMode mode, PropertyGenerator shaderPropertiesVisitor);
string GetVariableNameForNode();
bool has3DPreview();
}
}

5
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/AbstractMasterNode.cs


public abstract string GetFullShader(GenerationMode mode, out List<PropertyGenerator.TextureInfo> configuredTextures);
public abstract string GetSubShader(GenerationMode mode, PropertyGenerator shaderPropertiesVisitor);
public virtual bool has3DPreview()
{
return true;
}
}
}
正在加载...
取消
保存