UnityEditor 查找和获取内置资源

Object[] UnityAssets = AssetDatabase.LoadAllAssetsAtPath("Resources/unity_builtin_extra");
foreach (var asset in UnityAssets) {
    Debug.Log(asset);
}

Debug.Log("===================================");
Debug.Log(Shader.Find("Sprites/Default"));

var mat1 = AssetDatabase.GetBuiltinExtraResource<Material>("Sprites-Default.mat");
Debug.Log($"mat1:{mat1}");

猜你喜欢

转载自blog.csdn.net/kingBook928/article/details/126542187