首页 > 其他 > 详细

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

时间:2015-05-26 12:02:38      阅读:77      评论:0      收藏:0      [点我收藏+]

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 将定义好的脚本绑定到对象中

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

原文:http://www.cnblogs.com/lv-sally/p/4530035.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!