Exemplo n.º 1
0
        void InitializeAssetList()
        {
            onProjectChange += RefreshList;

            createAssetIcon = new GUIContent(EditorGUIUtility.FindTexture("CreateAddNew"), "创建Asset");
            searchField     = new SearchField();
            searchField.autoSetFocusOnFindCommand = true;
            projecListTreeView = BuildAssetsListTreeView();
            projecListTreeView.Reload();
        }
Exemplo n.º 2
0
        protected virtual TimelineLitesTreeView BuildAssetsListTreeView()
        {
            TimelineLitesTreeView projecListTreeView = new TimelineLitesTreeView(TreeViewState, searchText, this);

            // 查找所有使用此类的ScriptableObjects
            string[] guids = AssetDatabase.FindAssets("t:" + TimelineLiteAssetType);

            for (int i = 0; i < guids.Length; i++)
            {
                string                        assetPath         = AssetDatabase.GUIDToAssetPath(guids[i]);
                TimelineLiteAsset             asset             = AssetDatabase.LoadAssetAtPath <TimelineLiteAsset>(assetPath);
                TimelineLiteAssetTreeViewItem assetTreeViewItem = new TimelineLiteAssetTreeViewItem(asset);
                projecListTreeView.AddItem(asset.GetType().Name, assetTreeViewItem);
            }
            return(projecListTreeView);
        }
Exemplo n.º 3
0
 public void RefreshList()
 {
     projecListTreeView.Clear();
     projecListTreeView = BuildAssetsListTreeView();
     projecListTreeView.Reload();
 }