浏览代码

Merge pull request #238 from Unity-Technologies/master-preview-fixes

Master preview missing RenderTexture fixes
/main
GitHub 7 年前
当前提交
f57c8cab
共有 1 个文件被更改,包括 11 次插入7 次删除
  1. 18
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/MasterPreviewView.cs

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


Add(middleContainer);
}
void OnScroll(float scrollValue)
{
float rescaleAmount = -scrollValue * .03f;
m_Graph.previewData.scale = Mathf.Clamp(m_Graph.previewData.scale + rescaleAmount, 0.2f, 5f);
}
void BuildContextualMenu(ContextualMenuPopulateEvent evt)
{
foreach (var primitiveTypeName in Enum.GetNames(typeof(PrimitiveType)))

m_PreviewRenderHandle.renderTexture.Release();
Object.DestroyImmediate(m_PreviewRenderHandle.renderTexture);
m_PreviewRenderHandle.renderTexture = new RenderTexture(descriptor);
m_PreviewRenderHandle.renderTexture = new RenderTexture(descriptor) { hideFlags = HideFlags.HideAndDontSave };
DirtyMasterNode(ModificationScope.Node);
}
public void UpdateRenderTextureOnNextLayoutChange()

{
UnregisterCallback<PostLayoutEvent>(AdaptRenderTextureOnLayoutChange);
RefreshRenderTextureSize();
}
void OnScroll(float scrollValue)
{
float rescaleAmount = -scrollValue * .03f;
m_Graph.previewData.scale = Mathf.Clamp(m_Graph.previewData.scale + rescaleAmount, 0.2f, 5f);
DirtyMasterNode(ModificationScope.Node);
}
void OnMouseDragPreviewMesh(Vector2 deltaMouse)

正在加载...
取消
保存