浏览代码

Add function in master preview to update rendertexture size after next layout change

/main
Jens Holm 7 年前
当前提交
de57de9e
共有 2 个文件被更改,包括 13 次插入0 次删除
  1. 11
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs
  2. 2
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs

11
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs


m_PreviewRenderHandle.renderTexture = new RenderTexture(descriptor);
}
public void UpdateRenderTextureOnNextLayoutChange()
{
RegisterCallback<PostLayoutEvent>(AdaptRenderTextureOnLayoutChange);
}
void AdaptRenderTextureOnLayoutChange(PostLayoutEvent evt)
{
UnregisterCallback<PostLayoutEvent>(AdaptRenderTextureOnLayoutChange);
RefreshRenderTextureSize();
}
void OnMouseDragPreviwMesh(Vector2 deltaMouse)
{
Vector2 previewSize = m_PreviewTextureView.contentRect.size;

2
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs


m_MasterPreviewView.layout = m_FloatingWindowsLayout.previewLayout.GetLayout(layout);
m_BlackboardProvider.blackboard.layout = m_FloatingWindowsLayout.blackboardLayout.GetLayout(layout);
m_MasterPreviewView.UpdateRenderTextureOnNextLayoutChange();
}
else
{

正在加载...
取消
保存