public class viewModel : MonoBehaviour {
public void B_Start(Button button)
{
//Changes the button's Normal color to the new color.
ColorBlock cb = button.colors;
cb.normalColor = Color.black;
button.colors = cb;
}
// Use this for initialization
public void Button_Click () {
Debug.Log("Hello World");
}
}
上面的代码更改了2D Unity环境中按钮的颜色。但是,当我在带有Unity的Vuforia AR中使用相同的代码时,为什么代码不起作用?