dp-s_doc/CallBack/Timer_Dispatch/Timer_Dispatch.md

42 lines
691 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Timer_Dispatch 回调函数文档
**回调说明**
`Timer_Dispatch`类用于在服务端中持续执行的HOOK。
---
**注册方法**
- `Cb_timer_dispatch_Func.rawset(Key,Function)`
**例子**
```squirrel
function Test_Function()
{
print(Clock());
}
Cb_timer_dispatch_Func.rawset("Test", Test_Function);
```
or
```squirrel
function Test_Function()
{
print(Clock());
}
Cb_timer_dispatch_Func.Test <- Test_Function;
```
or
```squirrel
function Test_Function()
{
print(Clock());
}
Cb_timer_dispatch_Func["Test"] <- Test_Function;
```
or
```squirrel
Cb_timer_dispatch_Func.Test <- function ()
{
print(Clock());
};
```