|
|
|
|
|
|
public Action onUpdateAssetClick { get; set; } |
|
|
|
public Action onConvertToSubgraphClick { get; set; } |
|
|
|
public Action onShowInProjectClick { get; set; } |
|
|
|
public Action onTimeClick { get; set; } |
|
|
|
|
|
|
|
public GraphEditorView() |
|
|
|
{ |
|
|
|
|
|
|
m_ToolbarView.Add(new ToolbarSpaceView()); |
|
|
|
m_ToolbarView.Add(new ToolbarSeparatorView()); |
|
|
|
|
|
|
|
var timeButton = new ToolbarButtonView { text = "Time" }; |
|
|
|
timeButton.AddManipulator(new Clickable(() => |
|
|
|
m_TimeButton = new ToolbarButtonView { text = "" }; |
|
|
|
m_TimeButton.AddManipulator(new Clickable(() => |
|
|
|
if (onTimeClick != null) onTimeClick(); |
|
|
|
if (presenter == null) |
|
|
|
return; |
|
|
|
if (presenter.previewRate == PreviewRate.Full) |
|
|
|
presenter.previewRate = PreviewRate.Throttled; |
|
|
|
else if (presenter.previewRate == PreviewRate.Throttled) |
|
|
|
presenter.previewRate = PreviewRate.Off; |
|
|
|
else if (presenter.previewRate == PreviewRate.Off) |
|
|
|
presenter.previewRate = PreviewRate.Full; |
|
|
|
m_TimeButton.text = "Preview rate: " + presenter.previewRate; |
|
|
|
m_ToolbarView.Add(timeButton); |
|
|
|
m_ToolbarView.Add(m_TimeButton); |
|
|
|
|
|
|
|
m_ToolbarView.Add(new ToolbarSeparatorView()); |
|
|
|
} |
|
|
|
|
|
|
{ |
|
|
|
m_GraphView.presenter = m_Presenter.graphPresenter; |
|
|
|
m_GraphInspectorView.presenter = m_Presenter.graphInspectorPresenter; |
|
|
|
m_TimeButton.text = "Preview rate: " + presenter.previewRate; |
|
|
|
ToolbarButtonView m_TimeButton; |
|
|
|
|
|
|
|
public GraphEditorPresenter presenter |
|
|
|
{ |
|
|
|
|
|
|
onUpdateAssetClick = null; |
|
|
|
onConvertToSubgraphClick = null; |
|
|
|
onShowInProjectClick = null; |
|
|
|
onTimeClick = null; |
|
|
|
if (m_GraphInspectorView != null) m_GraphInspectorView.Dispose(); |
|
|
|
} |
|
|
|
} |