好的,我现在正在学习unity,我今天早上打开我的游戏,遇到了这个错误代码
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0619:
'GUIText' is obsolete: 'GUIText has been removed. Use UI.Text instead.' 我曾尝试用UI.Text替换GUIText,但这导致了不同的错误消息:
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0246:
The type or namespace name 'UI' could not be found (are you missing a using
directive or an assembly reference?)或
Assets\Standard Assets\Utility\SimpleActivatorMenu.cs(11,16): error CS0246:
The type or namespace name 'UIText' could not be found (are you missing a using
directive or an assembly reference?)有人能帮我吗?
发布于 2020-04-25 03:23:24
不幸的是,您不能简单地将GUIText替换为文本。看看这个答案:
发布于 2020-05-20 02:00:05
您可以使用UnityEngine.UI中的Text替换它
下面是一个例子:
using UnityEngine.UI;
namespace YourNameSpace.Utility
{
public class YourClass : MonoBehaviour
{
public Text myText;
void Start()
{
myText.text = "Your text here";
}
}
}发布于 2021-03-11 06:18:15
您应该停用这些步骤
https://stackoverflow.com/questions/61411141
复制相似问题