protected virtual void InitializeResources(IReadOnlyList <ILevelEditorResource> resourcesList)
        {
#if !ALE_STRIP_SAFETY || UNITY_EDITOR
            if (!(resourcesList is IReadOnlyList <LevelEditorResource>))
            {
                throw new NotSupportedException("LevelEditorResourceView only works with LevelEditorResource classes.");
            }
#endif

            // This needs to be done to avoid a problem with opening up the resources object in the editor.
            LevelEditorResource[] newResources = new LevelEditorResource[resourcesList.Count];
            for (int i = 0; i < newResources.Length; i++)
            {
                newResources[i] = new LevelEditorResource(resourcesList[i] as LevelEditorResource);
            }

            // Need to create a copy here or else the children will not work in the asset view.
            LevelEditorResource[] resourcesCopy = new LevelEditorResource[newResources.Length];
            for (int i = 0; i < resourcesList.Count; i++)
            {
                resourcesCopy[i] = new LevelEditorResource(newResources[i]);
            }

            allAssets     = TreeUtility.AssignChildren(newResources);
            treeRoot      = TreeUtility.ListToTree(resourcesCopy, true);
            treeRoot.Name = rootName;

            folderTree.Initialize(child => ((LevelEditorResource)child).Parent, parent =>
            {
                List <object> children = new List <object>();
                children.AddRange(((LevelEditorResource)parent).Children);

                return(children);
            });

            if (showRoot)
            {
                folderTree.SetItems(new LevelEditorResource[1] {
                    treeRoot
                });
                folderTree.SelectItem(treeRoot);
            }
            else
            {
                for (int i = 0; i < treeRoot.Children.Count; i++)
                {
                    treeRoot.Children[i].Parent = null;                     // Remove parent so they don't get indented.
                }

                folderTree.SetItems(treeRoot.Children);
                folderTree.SelectItem(treeRoot.Children[0]);
            }
        }