少年修仙传客户端基础资源
client_Wu Xijin
2018-10-30 d0a0f4e224e138f84bc4373fe4e9cc2c96d6160c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- --------------------------------------------------------
--    [Author]:            第二世界
--    [  Date ]:           #DateTime#
-- --------------------------------------------------------
 
require('global.stringutil')
 
#ClassName#Config = {}
local Configs={}
 
function #ClassName#Config.Init()
    local path
    if CS.AssetSource.refdataFromEditor then
        path = CS.ResourcesPath.CONFIG_FODLER .. '/#ClassName#.txt'
    else
        path = CS.AssetVersionUtility.GetAssetFilePath('config/#ClassName#.txt')
    end
 
    local datas = CS.FileExtersion.ReadFileAllLines(path)
    local length = datas.length
    local lines = datas.lines
 
    for i = 3, length - 1 do
        local contents = Split(lines[i], '\t')
        local key = contents[1]
        local subTable = {}
        #Read#
        Configs[tostring(key)] = subTable
    end
end
 
function #ClassName#Config.GetConfig(key)
    return Configs[tostring(key)]
end