首页 > 其他分享 >引用错误导致的问题

引用错误导致的问题

时间:2022-08-30 23:13:13浏览次数:40  
标签:UnityEngine 错误 button 导致 UIElements UI 引用 GetComponent

本来是引用UnityEngine.UI

获取button来添加功能的

结果引用了UniytEngine.UIElements

导致我一直Get不到button,Image等UI组件

不过凑巧发现了UIEngine的代码,可能会对后面自己搭建UI框架有较大启发

 

UIElements

包位置:  项目名字\Library\PackageCache\[email protected]\Runtime\UI\Core

报错信息:  ArgumentException: GetComponent requires that the requested component 'Button' derives from MonoBehaviour or Component or is an interface.

UnityEngine.GameObject.GetComponent[T] () (at <1b1edefaa08b47a39f5182510f3f9ef9>:0)

搜索

复制

标签:UnityEngine,错误,button,导致,UIElements,UI,引用,GetComponent
From: https://www.cnblogs.com/qifenshu/p/16641252.html

相关文章