【问题标题】:`UILabel' could not be found找不到“UILabel”
【发布时间】:2013-10-17 05:57:20
【问题描述】:

当我将 Demo.cs 放在标准资产文件夹中时,我收到此错误:

Assets/Standard Assets/Demo.cs(130,17): error CS0246: The type or namespace name 'UILabel' could not be found. Are you missing a using directive or an assembly reference?

当我将 Demo.cs 资产文件夹放在上面时,错误得到解决 但我不能从我的另一个 Demo1.js 调用任何 Demo.cs 方法

给出错误:
Assets/Scripts/Demo1.js(81,20): BCE0018: The name 'Demo' does not denote a valid type ('not found').

有什么办法吗?

【问题讨论】:

  • 我认为 UILabel 是 NGUI 框架的一部分。如果您使用的是 NGUI,您应该将其文件移到标准资源中,或者将 Demo.cs 从标准资源中移出。
  • 已解决复制标准资产中的所有 NGUI 内容,除了我保留在资产中的一个文件夹“编辑器”

标签: c# unity3d unityscript ngui


【解决方案1】:

我无法从 unityscript 访问 NGUI 组件 从以下链接获得解决方案

http://www.tasharen.com/forum/index.php?topic=6.0

【讨论】:

    【解决方案2】:

    您正在寻找的 UILabel 类可能是 NGUI 的一部分。

    将 NGUI 从资源商店导入到您当前的项目中(假设您已经购买了它),Unity 会找到该类。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多