1111
This commit is contained in:
48
CallBack/Use_Item_Sp/Use_Item_Sp.md
Normal file
48
CallBack/Use_Item_Sp/Use_Item_Sp.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# Use_Item_Sp 回调函数文档
|
||||
|
||||
**回调说明**:
|
||||
`Use_Item_Sp`类用于处理游戏中的玩家使用特殊道具事件。
|
||||
|
||||
---
|
||||
|
||||
**注册方法**:
|
||||
- `Cb_Use_Item_Sp_Func.rawset(Key,Function)`
|
||||
**注意事项**:
|
||||
- `此函数有返回值如果返回false 则本次使用道具不在执行原逻辑`
|
||||
|
||||
**例子**:
|
||||
|
||||
```squirrel
|
||||
function Test_Function(SUser, ItemId)
|
||||
{
|
||||
print(”使用道具“);
|
||||
return true;
|
||||
}
|
||||
Cb_Use_Item_Sp_Func.rawset("Test", Test_Function);
|
||||
```
|
||||
or
|
||||
```squirrel
|
||||
function Test_Function(SUser, ItemId)
|
||||
{
|
||||
print(”使用道具“);
|
||||
return true;
|
||||
}
|
||||
Cb_Use_Item_Sp_Func.Test <- Test_Function;
|
||||
```
|
||||
or
|
||||
```squirrel
|
||||
function Test_Function(SUser, ItemId)
|
||||
{
|
||||
print(”使用道具“);
|
||||
return true;
|
||||
}
|
||||
Cb_Use_Item_Sp_Func["Test"] <- Test_Function;
|
||||
```
|
||||
or
|
||||
```squirrel
|
||||
Cb_Use_Item_Sp_Func.Test <- function (SUser, ItemId)
|
||||
{
|
||||
print(”使用道具“);
|
||||
return true;
|
||||
};
|
||||
```
|
||||
Reference in New Issue
Block a user