“LlStartObjectAnimation”的版本间的差异
(创建页面,内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}} {{函数详情 |函数名 = Function: llStartObjectAnimation( string anim ); |参数= 参数:f…”) |
|||
| 第4行: | 第4行: | ||
{{函数详情 | {{函数详情 | ||
|函数名 = Function: llStartObjectAnimation( string anim ); | |函数名 = Function: llStartObjectAnimation( string anim ); | ||
| − | |参数= | + | |参数= 参数: |
| − | |返回值= | + | •字符串动画–当前对象清单中动画的名称 |
| + | |返回值= 返回值:启动当前对象的动画。 | ||
| − | |注意事项= | + | |注意事项=与[[llStartAnimation]]不同,必须使用[[llStopObjectAnimation]]从[[llGetObjectAnimationNames]]列表中显式删除Animesh非循环动画,并且在移除之前不能再次启动。这将通过脚本重置持续存在。 |
| + | 笔记: | ||
| + | 动画对象的工作原理是将骨架与包含一个或多个装配网格图元的链接集相关联。当动画由链接集中任何基元中的脚本播放时,骨架将设置动画,链接集中的任何装配网格也将相应地移动。在链接集的任何prim中运行的脚本可以使用新命令启动、停止或查询动画。这些函数的典型用法是在链接集的根prim中执行所有对象动画脚本;在这种情况下,动画和脚本都将是该prim目录的一部分,也是整个对象的一部分。但是,如果脚本和动画出现在链接集的多个prim中,那么了解动画在每个prim中是独立启动、停止和跟踪的,这一点很重要。 | ||
|示例= | |示例= | ||
示例1 | 示例1 | ||
<pre> | <pre> | ||
| + | //只要对象被触摸,这个脚本就会为其设置动画。 | ||
| + | //This script animates the object for as long as it is touched. | ||
| + | default | ||
| + | { | ||
| + | state_entry() | ||
| + | { | ||
| + | } | ||
| + | |||
| + | // This assumes that an animation called "MyFancyWalk" is present in the inventory of the current object. | ||
| + | touch_start(integer total_number) | ||
| + | { | ||
| + | llSay(0, "Starting animation"); | ||
| + | llStartObjectAnimation("MyFancyWalk"); | ||
| + | } | ||
| + | |||
| + | touch_end(integer total_number) | ||
| + | { | ||
| + | llSay(0, "Stopping animation"); | ||
| + | llStopObjectAnimation("MyFancyWalk"); | ||
| + | } | ||
| + | } | ||
</pre> | </pre> | ||
| − | |||
|相关函数= | |相关函数= | ||
| − | [[ | + | [[llStopObjectAnimation]]–停止在当前对象中播放动画 |
| − | |||
| − | |||
| − | [[ | + | [[llGetObjectAnimationNames]] –列出当前对象中当前正在播放的动画 |
| − | |相关事件= | + | |相关事件=无 |
}} | }} | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
2020年8月10日 (一) 08:20的最新版本
| 首页 | 函数 | 事件 | 类型 | 操作符 | 常数 | Flow Control | Script Library | Categorized Library | Tutorials |
| 函数名 |
|---|
| Function: llStartObjectAnimation( string anim ); |
| 参数:
•字符串动画–当前对象清单中动画的名称 |
| 返回值:启动当前对象的动画。 |
| 注意事项 |
|---|
| 与llStartAnimation不同,必须使用llStopObjectAnimation从llGetObjectAnimationNames列表中显式删除Animesh非循环动画,并且在移除之前不能再次启动。这将通过脚本重置持续存在。
笔记: 动画对象的工作原理是将骨架与包含一个或多个装配网格图元的链接集相关联。当动画由链接集中任何基元中的脚本播放时,骨架将设置动画,链接集中的任何装配网格也将相应地移动。在链接集的任何prim中运行的脚本可以使用新命令启动、停止或查询动画。这些函数的典型用法是在链接集的根prim中执行所有对象动画脚本;在这种情况下,动画和脚本都将是该prim目录的一部分,也是整个对象的一部分。但是,如果脚本和动画出现在链接集的多个prim中,那么了解动画在每个prim中是独立启动、停止和跟踪的,这一点很重要。 |
| 示例 |
|---|
示例1
//只要对象被触摸,这个脚本就会为其设置动画。
//This script animates the object for as long as it is touched.
default
{
state_entry()
{
}
// This assumes that an animation called "MyFancyWalk" is present in the inventory of the current object.
touch_start(integer total_number)
{
llSay(0, "Starting animation");
llStartObjectAnimation("MyFancyWalk");
}
touch_end(integer total_number)
{
llSay(0, "Stopping animation");
llStopObjectAnimation("MyFancyWalk");
}
}
|
| 相关函数 |
|---|
| llStopObjectAnimation–停止在当前对象中播放动画
llGetObjectAnimationNames –列出当前对象中当前正在播放的动画 |
| 相关事件 |
|---|
| 无 |