在下载并导入统一的纸板sdk之后,我得到了这些错误。我搜索了错误CS0246,但答案无法解决。或我没有任何错字。我没有更改google提供的代码中的任何一个单词。它在Windows 7和android上,我使用的是unity 4.3。有什么建议?
资产/纸板/脚本/纸板.cs(420,4):错误CS0246:找不到类型或名称空间名称“工具提示”。您是否缺少using指令或程序集引用
资产/纸板/脚本/StereoController.cs(87,4):错误CS0246:找不到类型或名称空间名称“ TooltipAttribute”。您是否缺少using指令或程序集引用?![在此处输入图像描述] [1]
您不能将Unity更新到最新的4.6吗?我认为Tooltip是Unity 4.5的新功能。那么,解决方案如何?
http://answers.unity3d.com/questions/37177/additional-information-on-mouseover-in-the-inspect.html
资产/脚本/TooltipAttribute.cs:
using UnityEngine;
public class TooltipAttribute : PropertyAttribute
{
public readonly string text;
public TooltipAttribute(string text)
{
this.text = text;
}
}
资产/编辑器/TooltipDrawer.cs:
using UnityEditor;
using UnityEngine;
[CustomPropertyDrawer(typeof(TooltipAttribute))]
public class TooltipDrawer : PropertyDrawer
{
public override void OnGUI(Rect position, SerializedProperty prop, GUIContent label)
{
var atr = (TooltipAttribute) attribute;
var content = new GUIContent(label.text, atr.text);
EditorGUI.PropertyField(position, prop, content);
}
}
现在,您可以在Unity 4.3中使用工具提示。我猜。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句