少年修仙传客户端基础资源
lwb
2020-11-20 523a8c5b8de799aeaeaa7287f0b4f9e2edf339ee
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 = {}
#ClassName#Config.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#
        #ClassName#Config.Configs[key] = subTable
    end
end
 
function #ClassName#Config.Get(id)
    return    #ClassName#Config.Configs[tostring(id)]
end