![](/img/trans.png)
[英]VR on Google Cardboard (android) using Unity ERROR
[英]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.