跳转至

Unity Editor Resources 测试⚓︎

Odin Toolkits 包含有多种编辑器阶段查看的资源,但是直接把所有内容放在 Editor 文件夹下会导致运行时脚本无法在运行时加载相关脚本。

可以创建一个 Editor Resources 文件夹,将所有编辑器阶段需要的资源放在里面,然后使用 AssetDatabase.LoadAllAssetsAtPath() 方法加载所有资源。

可以使用 Editor/Resources/ 文件夹,可以使用 Resources.Load 方法加载 Editor 下的资源。

注意

Note: If the Resources folder is an Editor subfolder, the Assets in it are loadable from Editor scripts, but are removed from builds.

评论