小
→thisActionIndex的用法
(→无参数部分) 标签:移动版编辑 移动版网页编辑 |
|||
| 第56行: | 第56行: | ||
局内只能在行动内使用,可用<code>alsoTriggerAction</code>或<code>alsoQueueAction</code>延长“寿命”,你也可以用内存将其存储。<code>thisActionTarget</code>在不同情况下所指代的单位不同,与<code>eventSource</code>不同,后者只与<code>autoTriggerOnEvent</code>绑定,触发的事件不同所指代的单位也不同。 | 局内只能在行动内使用,可用<code>alsoTriggerAction</code>或<code>alsoQueueAction</code>延长“寿命”,你也可以用内存将其存储。<code>thisActionTarget</code>在不同情况下所指代的单位不同,与<code>eventSource</code>不同,后者只与<code>autoTriggerOnEvent</code>绑定,触发的事件不同所指代的单位也不同。 | ||
===thisActionIndex的用法=== | ===thisActionIndex的用法=== | ||
<code>thisActionIndex</code>能在遍历过程中同时知道每个元素的位置信息,<code>index</code>为其缩略形式。受<code>alsoTriggerActionRepeat</code>与<code>takeResources_triggerActionForEach</code> | <code>thisActionIndex</code>能在遍历过程中同时知道每个元素的位置信息,<code>index</code>为其缩略形式。受<code>alsoTriggerActionRepeat</code>与<code>takeResources_triggerActionForEach</code>影响。值为int(整数)类型,从0开始,用于遍历数组。 | ||
eg:<code>[hiddenAction_1] | |||
alsoTriggerAction:2 | |||
alsoTriggerActionRepeat:memory.array.size | |||
[hiddenAction_2] | |||
setUnitMemory:array[index]=select(memory.array[index]==0,0,memory.array[index]-1)</code> | |||
===对应的情况=== | ===对应的情况=== | ||