gpt4 book ai didi

c# - 通过代码使 Texture2D 在 Unity 中可读

转载 作者:太空狗 更新时间:2023-10-29 18:14:53 25 4
gpt4 key购买 nike

<分区>

我有一些要转换为 .png 图像文件的 AssetBundle。

它们是 Texture2D Assets ,但问题是它们不是 Read Enable,当我尝试使用

将它们转换为 PNG
var _bytes = _texture2d.EncodeToPNG();

命令,我收到以下错误消息:

Texture 'name of a texture' is not readable, the texture memory can not be accessed from scripts. You can make the texture readable in the Texture Import Settings.

我真的无法访问纹理导入设置,因为它们来自 Assets 包,而且一切都是用代码制作的。

有人对此有解决方法吗?

谢谢

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com