关于state的启动与停止.
作者:梦翔儿 日期:2007-7-23 15:39:00
关于state的启动与停止.
default
{
        touch_start(integer num_detected)  //when touched
    {
        state start;                        //go to state start
    }
}
    state start
    {
        state_entry()                            //state start has
        {                                       //state start has
            llSay(0,"You're in state entry");   //the firest real action
        }
       
        touch_start(integer num_detected)       //when touched again
        {
            state default;                      //stop script,but when   
        }
       
        state_exit()                           //script is over
        {
            llSay(0,"You stopped script");      //say this   
        }
    }

这是标准的单击激活动作,很常用,再单击停止动作了.当然也可以把他扩展为点击变色,再点还原;点击变透明,再点还原;
  • 标签:state second life lsl 
  • 发表评论:

      大名:
      密码: (游客无须输入密码)
      主页:
      标题:
    Powered by Oblog.