初始化提交
This commit is contained in:
37
Content/Lua/GamePlay/Utils.lua
Normal file
37
Content/Lua/GamePlay/Utils.lua
Normal file
@ -0,0 +1,37 @@
|
||||
local _M = {}
|
||||
local GameplayTag = import("GameplayTag")
|
||||
local BusyGamePlayLibrary = import("BusyGamePlayLibrary")
|
||||
|
||||
local function GetConfig(func_name, config_id)
|
||||
local state, config = BusyGamePlayLibrary[func_name](config_id, nil)
|
||||
if state == true then
|
||||
return config
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
function _M.GetItemConfigByID(item_id)
|
||||
return GetConfig("GetLevelItemConfig", item_id)
|
||||
end
|
||||
|
||||
function _M.GetItemResourceConfig(item_id)
|
||||
return GetConfig("GetItemResourceConfig", item_id)
|
||||
end
|
||||
|
||||
function _M.GetItemDescConfig(item_id)
|
||||
return GetConfig("GetLevelItemDescription", item_id)
|
||||
|
||||
end
|
||||
|
||||
function _M.GetRoleConfigByID(role_id)
|
||||
return GetConfig("GetRoleConfig", role_id)
|
||||
end
|
||||
|
||||
function _M.GetGameplayTag(name)
|
||||
local tag = GameplayTag(name)
|
||||
tag.TagName = name
|
||||
return tag
|
||||
end
|
||||
|
||||
return _M
|
||||
Reference in New Issue
Block a user