Zh/Dota 2 Workshop Tools/Scripting/ThinkerFunctions: Difference between revisions
< Zh | Dota 2 Workshop Tools | Scripting
Jump to navigation
Jump to search
mNo edit summary |
m (Using L template for links) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{{lang|title=Thinker函数|Dota 2 Workshop Tools/Scripting/ThinkerFunctions}} | {{lang|title=Thinker函数|Dota 2 Workshop Tools/Scripting/ThinkerFunctions}} | ||
{{L|Think}}可以随时通过<code>SetThink</code>来注册。多个think函数可以同时在一个实体上同时运行,但是为了避免覆盖这需要think函数各自命名. | |||
== 使用方法 == | == 使用方法 == |
Latest revision as of 07:54, 11 July 2024
Think 可以随时通过SetThink
来注册。多个think函数可以同时在一个实体上同时运行,但是为了避免覆盖这需要think函数各自命名.
使用方法
SetThink( "ThinkerFunction", self, "thinkerNameString", 1 )
ThinkerFunction
- 这可以是一个要调用的方法的字符串, 或者是一个方法对象。
以下参数是可选的:
ThinkerFunctionScope
- 这可以是一个表,使在这对象上为ThinkerFunction附以索引。类似think的调回,这样可以得到成员方法。thinkerNameString
- thinker的名字。使用这个可以控制多个thinker。1
- 在thinker开始计时之前设定延迟多少秒的数字。
返回nil的话可以注销thinker并且使它停止。返回一个数字来设定下一次think的时间。