using UnityEngine;
using System.Collections.Generic;
using UnityEditor;
public class TryFindEditor : EditorWindow
{
// Add menu item named "My Window" to the Window menu
[MenuItem("Window/Find All Type")]
public static void ShowWindow()
{
//Show existing window instance. If one doesn't exist, make one.
EditorWindow.GetWindow(typeof(TryFindEditor));
}
List allMaterials;
void OnGUI()
{
if (GUILayout.Button("Load"))
{
allMaterials = new List();
string[] paths = AssetDatabase.GetAllAssetPaths();
foreach (string path in paths)
{
Material mat = (Material)AssetDatabase.LoadAssetAtPath(path, typeof(Material));
if (mat != null)
{
Debug.Log(mat.name);
allMaterials.Add(mat);
}
}
Debug.Log(allMaterials.Count);
}
}
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。