Unity报错记录大全

1Resource.load不能在分线程加载资源,报错以下

Load can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
UnityEngine.Resources:Load(String)
JoinManager:LoadingModel(String, String) (at Assets/Script/JoinManager.cs:36)
Message:InitRequest(String) (at Assets/Script/Message.cs:86)
Message:ReadMessage() (at Assets/Script/Message.cs:49)
Client:ReceiveCallBack(IAsyncResult) (at Assets/Script/Client.cs:89)
System.Net.Sockets.Worker:Receive()
报这个错误就是说明,加载资源不能在分线程加载,因为我在做网络模块的时候是采取异步接收数据的,所以我在异步接收数据的同时就启用加载,所以报错了,只要使用别的方法,让他在主线程加载资源就可以了

2Destroy删除本体

Destroying assets is not permitted to avoid data loss.
If you really want to remove an asset use DestroyImmediate (theObject, true);
UnityEngine.Object:Destroy(Object)
JoinManager:Update() (at Assets/Script/JoinManager.cs:75)

这个错误就是创建一个克隆体,然后不进行名字更改,就会报这个错误,因为你删除的是本体,所以克隆出来的时候呀对模型进行改名字,然后删除的时候,要使用名字查找的方式去删除

3开发AR,识别模型后,模型出现的纯色块问题

这种色块的原因是由于光照的实时渲染,无法快速补偿贴图导致纯色块,所以只要关闭自动生成贴图即可

 

未完待续....................

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一丁目赠我

谢谢你的打赏,感谢

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值