浏览代码

Update master preview rendertexture size when layout has finished changeing

/main
Jens Holm 7 年前
当前提交
12be2cf3
共有 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_Graph.previewData.serializedMesh.mesh = changedMesh;
}
public void RefreshRenderTextureSize()
{
RenderTextureDescriptor descriptor = m_PreviewRenderHandle.renderTexture.descriptor;
descriptor.width = (int)m_PreviewTextureView.contentRect.width;
descriptor.height = (int)m_PreviewTextureView.contentRect.height;
m_PreviewRenderHandle.renderTexture.Release();
m_PreviewRenderHandle.renderTexture = new RenderTexture(descriptor);
}
void OnMouseDragPreviwMesh(Vector2 deltaMouse)
{
Vector2 previewSize = m_PreviewTextureView.contentRect.size;

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


string serializedWindowLayout = JsonUtility.ToJson(m_FloatingWindowsLayout);
EditorUserSettings.SetConfigValue(m_FloatingWindowsLayoutKey, serializedWindowLayout);
m_MasterPreviewView.RefreshRenderTextureSize();
}
public void Dispose()

正在加载...
取消
保存