2025-03-23 18:51:55 +08:00
|
|
|
|
# Chacter_Exit 回调函数文档
|
|
|
|
|
|
|
|
|
|
|
|
**回调说明**:
|
2025-11-20 16:31:34 +08:00
|
|
|
|
`Chacter_Exit`类用于处理游戏中的玩家退出事件。```选择角色```不会触发该回调
|
2025-03-23 18:51:55 +08:00
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
**注册方法**:
|
|
|
|
|
|
- `Cb_player_exit_Func.rawset(Key,Function)`
|
|
|
|
|
|
|
|
|
|
|
|
**例子**:
|
|
|
|
|
|
|
|
|
|
|
|
```squirrel
|
|
|
|
|
|
function Test_Function(SUser)
|
|
|
|
|
|
{
|
|
|
|
|
|
print("退出");
|
|
|
|
|
|
}
|
|
|
|
|
|
Cb_player_exit_Func.rawset("Test", Test_Function);
|
|
|
|
|
|
```
|
|
|
|
|
|
or
|
|
|
|
|
|
```squirrel
|
|
|
|
|
|
function Test_Function(SUser)
|
|
|
|
|
|
{
|
|
|
|
|
|
print("退出");
|
|
|
|
|
|
}
|
|
|
|
|
|
Cb_player_exit_Func.Test <- Test_Function;
|
|
|
|
|
|
```
|
|
|
|
|
|
or
|
|
|
|
|
|
```squirrel
|
|
|
|
|
|
function Test_Function(SUser)
|
|
|
|
|
|
{
|
|
|
|
|
|
print("退出");
|
|
|
|
|
|
}
|
|
|
|
|
|
Cb_player_exit_Func["Test"] <- Test_Function;
|
|
|
|
|
|
```
|
|
|
|
|
|
or
|
|
|
|
|
|
```squirrel
|
|
|
|
|
|
Cb_player_exit_Func.Test <- function (SUser)
|
|
|
|
|
|
{
|
|
|
|
|
|
print("退出");
|
|
|
|
|
|
};
|
|
|
|
|
|
```
|