Ejemplo n.º 1
0
        /// <summary>
        /// Initialize the manager after deserialization.
        /// </summary>
        public override void Initialize(MainManagerWindow mainManagerWindow)
        {
            base.Initialize(mainManagerWindow);

            // Look for the ItemCollection within the scene if it isn't already populated.
            if (m_ItemCollection == null)
            {
                m_ItemCollection = ManagerUtility.FindItemCollection(m_MainManagerWindow);
            }

            // The ItemCollection may have been serialized.
            if (m_ItemCollection != null)
            {
                // The category may be invalid.
                var categories = m_ItemCollection.Categories;
                if (categories != null)
                {
                    for (int i = categories.Length - 1; i > -1; --i)
                    {
                        if (categories[i] != null)
                        {
                            continue;
                        }
                        ArrayUtility.RemoveAt(ref categories, i);
                    }
                    m_ItemCollection.Categories = categories;
                }

                // The CategoryState would have been reconstructed after deserialization so update the state within the tree.
                m_CategoryTreeView.state.expandedIDs   = m_CategoryTreeViewState.expandedIDs;
                m_CategoryTreeView.state.lastClickedID = m_CategoryTreeViewState.lastClickedID;
                m_CategoryTreeView.state.searchString  = m_CategoryTreeViewState.searchString;
                m_CategoryTreeView.state.selectedIDs   = m_CategoryTreeViewState.selectedIDs;
                m_CategoryTreeViewState = m_CategoryTreeView.state;

                // Update the tree with the new collection.
                (m_CategoryTreeView.TreeModal as CategoryCollectionModal).ItemCollection = m_ItemCollection;
                m_CategoryTreeView.Reload();

                // The TreeViewState would have been reconstructed after deserialization so update the state within the tree.
                m_ItemTypeTreeView.state.expandedIDs   = m_ItemTypeTreeViewState.expandedIDs;
                m_ItemTypeTreeView.state.lastClickedID = m_ItemTypeTreeViewState.lastClickedID;
                m_ItemTypeTreeView.state.searchString  = m_ItemTypeTreeViewState.searchString;
                m_ItemTypeTreeView.state.selectedIDs   = m_ItemTypeTreeViewState.selectedIDs;
                m_ItemTypeTreeViewState = m_ItemTypeTreeView.state;

                // Update the tree with the new collection.
                (m_ItemTypeTreeView.TreeModal as ItemTypeCollectionModal).ItemCollection = m_ItemCollection;
                m_ItemTypeTreeView.Reload();
            }
        }
Ejemplo n.º 2
0
 public void Initialize(AnimationStateSet animationStateSet = null)
 {
     treeView.state.expandedIDs   = state.expandedIDs;
     treeView.state.lastClickedID = state.lastClickedID;
     treeView.state.searchString  = state.searchString;
     treeView.state.selectedIDs   = state.selectedIDs;
     state = treeView.state;
     this.animationStateSet = animationStateSet;
     (treeView.TreeModal as AnimationStateModel).AnimationStateSet = this.animationStateSet;
     treeView.Reload();
 }
Ejemplo n.º 3
0
 void ClearList()
 {
     m_TreeView.m_itemList.Clear();
     m_TreeView.Reload();
 }