我在Unity 4.6中通过添加UI按钮在我的层次结构中创建了一个按钮,我想使用c#脚本引用该按钮并将其Interact able值更改为true。
答案 0 :(得分:0)
嗯我不知道Unity3D UI有Interact成员。但是如果你想要引用Unity3D的新UI,首先必须添加UnityEngine.UI名称空间。
using UnityEngine.UI;
public Button myButton;
//make it public so you can Drag the Button GameObject to the Inspector
希望这有帮助。