EditorGUIUtility.Load()

作者:追风剑情 发布于:2017-12-27 11:47 分类:Unity3d

先来看看这个方法的实现(可通过ILSpy反编译UnityEngine.dll查看源码)

// UnityEditor.EditorGUIUtility
[TypeInferenceRule(TypeInferenceRules.TypeReferencedBySecondArgument)]
private static UnityEngine.Object Load(string filename, Type type)
{
	UnityEngine.Object @object = AssetDatabase.LoadAssetAtPath("Assets/Editor Default Resources/" + filename, type);
	if (@object != null)
	{
		return @object;
	}
	return EditorGUIUtility.GetEditorAssetBundle().Load(filename, type);
}

从上面实现可知,此方法优先加载Assets/Editor Default Resources/下面的资源,如果没找到再从unity的内置资源中找。

标签: Unity3d

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号