コード例 #1
0
 public void OnInspectorUpdate()
 {
     if (m_DataStore != null && m_DataStore.Repopulate() && m_TreeView != null)
     {
         m_TreeView.FullReload();
     }
     else if (m_TreeView != null && m_TreeView.Update())
     {
         m_TreeView.Repaint();
     }
 }
コード例 #2
0
        public void Update()
        {
            bool needsReload = false;

            if (m_DataStore != null)
            {
                // If we re-populated all data, we need to clear the cached items
                // The data can also be fine, but needs a reload without having to rebuild it all (inactive/active objects changed)
                if (m_DataStore.Repopulate(out needsReload))
                {
                    m_Items = null;
                }

                if (needsReload)
                {
                    Reload();
                    return;
                }
            }

            var rows = GetRows();
            int first, last;

            GetFirstAndLastVisibleRows(out first, out last);

            bool changed = false;

            if (last != -1)
            {
                for (int i = first; i <= last; i++)
                {
                    changed = changed || ((SerializedPropertyItem)rows[i]).GetData().Update();
                }
            }

            if (changed)
            {
                Repaint();
            }
        }