|
|
|
|
|
|
get { return m_Expanded;} |
|
|
|
} |
|
|
|
|
|
|
|
bool m_RecalculateLayout; |
|
|
|
|
|
|
|
Vector2 m_ExpandedPreviewSize; |
|
|
|
|
|
|
|
VisualElement m_CollapsePreviewContainer; |
|
|
|
|
|
|
Add(m_PreviewResizeBorderFrame); |
|
|
|
|
|
|
|
m_ExpandedPreviewSize = new Vector2(256f, 256f); |
|
|
|
m_RecalculateLayout = false; |
|
|
|
previewTextureView.RegisterCallback<GeometryChangedEvent>(OnGeometryChanged); |
|
|
|
} |
|
|
|
|
|
|
|
void UpdateExpandedButtonState() |
|
|
|
|
|
|
RemoveFromClassList("expanded"); |
|
|
|
AddToClassList("collapsed"); |
|
|
|
} |
|
|
|
|
|
|
|
m_RecalculateLayout = true; |
|
|
|
} |
|
|
|
|
|
|
|
Image CreatePreview(Texture texture) |
|
|
|
|
|
|
ShowMethod.Invoke(Get(), new object[] { null, typeof(Mesh), null, false, null, (Action<Object>)OnMeshChanged, (Action<Object>)OnMeshChanged }); |
|
|
|
} |
|
|
|
|
|
|
|
public void RefreshRenderTextureSize() |
|
|
|
void OnGeometryChanged(GeometryChangedEvent evt) |
|
|
|
if (m_RecalculateLayout) |
|
|
|
{ |
|
|
|
WindowDockingLayout dockingLayout = new WindowDockingLayout(); |
|
|
|
dockingLayout.CalculateDockingCornerAndOffset(layout, parent.layout); |
|
|
|
dockingLayout.ApplyPosition(this); |
|
|
|
m_RecalculateLayout = false; |
|
|
|
} |
|
|
|
|
|
|
|
if (!expanded) |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
m_PreviewManager.ResizeMasterPreview(new Vector2(targetWidth, targetHeight)); |
|
|
|
} |
|
|
|
|
|
|
|
public void UpdateRenderTextureOnNextLayoutChange() |
|
|
|
{ |
|
|
|
RegisterCallback<GeometryChangedEvent>(AdaptRenderTextureOnLayoutChange); |
|
|
|
} |
|
|
|
|
|
|
|
void AdaptRenderTextureOnLayoutChange(GeometryChangedEvent evt) |
|
|
|
{ |
|
|
|
UnregisterCallback<GeometryChangedEvent>(AdaptRenderTextureOnLayoutChange); |
|
|
|
RefreshRenderTextureSize(); |
|
|
|
} |
|
|
|
|
|
|
|
void OnScroll(float scrollValue) |
|
|
|