Unity错误提示大全(遇到问题就更新)

记录下使用Unity中遇到的所有错误提示

1.Unhandled Exception: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

  at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)

   at System.Reflection.Assembly.GetTypes () [0x00000] in <filename unknown>:0

问题描述:

添加dllunity立马报错

问题根源:

dll的类库项目使用的是.NET 4.5 , unity 只支持.NET 2.0

解决方案:

修改dll的类库项目属性->应用程序->目标框架 为.NET 2.0

 

2.NullReferenceException: Object reference not set to an instance of an object

问题根源:

未将对象引用设置到对象的实例

定义了个TweenPosition变量tween,忘记赋值,后面直接调用tween.playforward方法

解决方案:

Awake里获取组件的引用,对变量tween进行赋值

tween = GetComponent<TweenPosition>();

 

转载于:https://www.cnblogs.com/fzxiaoyi/p/8446158.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值