Ejemplo n.º 1
0
        void SaveAndRepaint()
        {
            if (m_ControllerSettings != null)
            {
                m_ControllerSettings.Save();
            }

            if (m_SelectedRecorderItem != null)
            {
                m_RecorderSettingPanel.Dirty(ChangeType.Layout | ChangeType.Styles);
            }

            Repaint();
        }
Ejemplo n.º 2
0
        void SetupModule(int newModuleIndex)
        {
            if (s_Instance == null)
            {
                return;
            }

            m_MainViewIMGUIElement.Clear();
            if (m_RegisteredModules.Count > newModuleIndex)
            {
                m_CurrentModuleIndex = newModuleIndex;
                if (m_CurrentModule != null)
                {
                    m_CurrentModule.OnModuleDeactivate();
                }

                m_CurrentModule = null;

                m_CurrentModule = m_RegisteredModules[newModuleIndex];

                m_CurrentModule.OnModuleActivate();
            }
            if (m_MainViewElement != null)
            {
                m_MainViewElement.Dirty(ChangeType.Repaint);
            }
            if (m_MainViewIMGUIElement != null)
            {
                m_MainViewIMGUIElement.Dirty(ChangeType.Repaint);
            }
        }
 private void UpdatePreviewLayout(VisualElement preview, Rect layout)
 {
     if (preview != null)
     {
         preview.layout             = layout;
         preview.style.positionType = PositionType.Relative;
         preview.Dirty(ChangeType.Layout);
     }
 }
Ejemplo n.º 4
0
 public void ClearInstructionHighlighter()
 {
     if (this.m_PaddingHighlighter != null && this.m_PaddingHighlighter.shadow.parent != null)
     {
         VisualElement parent = this.m_PaddingHighlighter.shadow.parent;
         this.m_PaddingHighlighter.RemoveFromHierarchy();
         this.m_ContentHighlighter.RemoveFromHierarchy();
         parent.Dirty(ChangeType.Repaint);
     }
 }
Ejemplo n.º 5
0
 public void UpdatePortInputVisibilities()
 {
     foreach (var portInputView in m_PortInputContainer.OfType <PortInputView>())
     {
         var slot          = portInputView.slot;
         var oldVisibility = portInputView.visible;
         portInputView.visible = expanded && !node.owner.GetEdges(node.GetSlotReference(slot.id)).Any();
         if (portInputView.visible != oldVisibility)
         {
             m_PortInputContainer.Dirty(ChangeType.Repaint);
         }
     }
 }
        private void AddPreviewHelper(VisualElement preview, int index, bool animated)
        {
            // Update the current preview with the newly added preview
            m_CurrentPreview = preview;

            Insert(index, m_CurrentPreview);

            if (animated)
            {
                Rect startRect = new Rect(Vector2.zero, m_CurrentPreview.layout.size);
                Rect endRect   = startRect;

                startRect.height        = 0f;
                m_AddAnimation.from     = startRect;
                m_AddAnimation.to       = endRect;
                m_AddAnimation.duration = animationDuration;
                m_AddAnimation.Start();
            }
            else
            {
                m_CurrentPreview.style.positionType = PositionType.Relative;
                m_CurrentPreview.Dirty(ChangeType.Layout);
            }
        }
 public static void MarkDirtyRepaint(this VisualElement element)
 {
     element.Dirty(ChangeType.Repaint);
 }
Ejemplo n.º 8
0
 internal static void SetDirty(VisualElement element)
 {
     #if !UNITY_2018_3_OR_NEWER
     element.Dirty(ChangeType.Layout | ChangeType.Styles);
     #endif
 }