void OnRecordBoundsButton() { if (m_BoundsRecorder != null) { m_BoundsRecorder.ToggleRecording(); } UpdateRecordingButton(); }
void UpdateBoundsRecorder() { if (m_AttachedComponent != null) { controller.RecompileExpressionGraphIfNeeded(); bool wasRecording = false; if (m_BoundsRecorder != null) { wasRecording = m_BoundsRecorder.isRecording; m_BoundsRecorder.CleanUp(); } m_BoundsRecorder = new VFXBoundsRecorder(m_AttachedComponent, m_View); if (wasRecording && !m_View.controller.isReentrant) //If this is called during an Undo/Redo, toggling the recording will cause a reentrant invalidation { m_BoundsRecorder.ToggleRecording(); } var systemNames = m_BoundsRecorder.systemNames; if (m_SystemBoundsContainer != null) { foreach (var elem in m_SystemBoundsContainer.Children()) { if (elem is VFXComponentBoardBoundsSystemUI) { (elem as VFXComponentBoardBoundsSystemUI).ReleaseBoundsRecorder(); } } m_SystemBoundsContainer.Clear(); m_SystemBoundsContainer.AddStyleSheetPath("VFXComponentBoard-bounds-list"); } foreach (var system in systemNames) { var tpl = VFXView.LoadUXML("VFXComponentBoard-bounds-list"); tpl.CloneTree(m_SystemBoundsContainer); VFXComponentBoardBoundsSystemUI newUI = m_SystemBoundsContainer.Children().Last() as VFXComponentBoardBoundsSystemUI; if (newUI != null) { newUI.Setup(system, m_BoundsRecorder); } } } }