public class AeeetEditorLoad
{
public static T Load<T>(string path) where T : Object
=> UnityEditor.AssetDatabase.LoadAssetAtPath<T>(path);
}
public class LoadTest : MonoBehaviour
{
public Sprite sprite;
// Start is called before the first frame update
void Start()
{
//Assets/ExcelTool/pngs/异常检测趋势图.png
sprite = AeeetEditorLoad.Load<Sprite>("文件路径");//Assets文件目录下的
}
}