浏览代码

Add acess to master previews texture view and add default size for preveiw in uss

/main
Jens Holm 7 年前
当前提交
11eb245d
共有 2 个文件被更改,包括 18 次插入4 次删除
  1. 20
      com.unity.shadergraph/Editor/Drawing/Inspector/MasterPreviewView.cs
  2. 2
      com.unity.shadergraph/Editor/Resources/Styles/MasterPreviewView.uss

20
com.unity.shadergraph/Editor/Drawing/Inspector/MasterPreviewView.cs


PreviewRenderData m_PreviewRenderHandle;
Image m_PreviewTextureView;
public Image previewTextureView
{
get { return m_PreviewTextureView; }
}
Vector2 m_PreviewScrollPosition;
ObjectField m_PreviewMeshPicker;

VisualElement m_Preview;
public VisualElement preview
{
get { return m_Preview; }
}
List<string> m_DoNotShowPrimitives = new List<string>( new string[] {PrimitiveType.Plane.ToString()});
static Type s_ContextualMenuManipulator = AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypesOrNothing()).FirstOrDefault(t => t.FullName == "UnityEngine.Experimental.UIElements.ContextualMenuManipulator");

}
Add(topContainer);
var middleContainer = new VisualElement {name = "middle"};
m_Preview = new VisualElement {name = "middle"};
middleContainer.Add(m_PreviewTextureView);
middleContainer.AddManipulator(new Scrollable(OnScroll));
preview.Add(m_PreviewTextureView);
preview.AddManipulator(new Scrollable(OnScroll));
Add(middleContainer);
Add(preview);
}
Image CreatePreview(Texture texture)

2
com.unity.shadergraph/Editor/Resources/Styles/MasterPreviewView.uss


flex-grow: 1;
border-width: 10;
border-color: rgb(200,10,190);
width: 200;
height: 200;
}
正在加载...
取消
保存