繁体   English   中英

谷歌纸板统一SDK android导入错误

[英]google cardboard unity sdk import error for android

下载并导入统一的纸板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中使用工具提示。 我猜。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM