tookit2D使用3——给精灵添加GUI按钮效果

1 使用tookit2d中GUI实现按钮效果
1.1 component-》2D tookit-》deprecated-》GUI—》toolkit2D button
1.2 添加鼠标按下抬起的精灵,添加声音,添加被绑定的在hirerarchy中的对象,添加message name(即脚本中自定义的函数名)
eg
public class btn_script : MonoBehaviour {

void btn_msg()
{
if (this.name == "btn_play")
{
Debug.Log("up");
}
else if (this.name == "btn_jixu")
{
Debug.Log("go on");
}
}

}
1.3 将定义好的脚本绑定到对象中

原文地址:https://www.cnblogs.com/lv-sally/p/4530035.html