-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimpls.lua
More file actions
78 lines (70 loc) · 2.2 KB
/
Copy pathimpls.lua
File metadata and controls
78 lines (70 loc) · 2.2 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
module = {}
Log = require("define").Log
---@param configs {[string]:string}
function module.configUpdate(configs)
Log:info {
["update.config"] = configs
}
for i, v in pairs(configs) do
Log:info({
["function"] = "update config",
["update"] = "Config",
["config." .. i] = v,
})
end
end
---@return nil | {[string]: SubScriptEntry}
function module.verifyApplicable(unityObject)
---@type {[string]: SubScriptEntry}
local ops = {
["A"] = {
name = "操作A",
entry = OperateA
},
["B"] = {
name = "操作B",
---@param script ScriptConfig
---@param unityObject any
---@param manager any
entry = function(script, unityObject, manager)
Log:info({ ["entry"] = "Operate B" })
Log:info({
["script"] = "B",
["state"] = "entry",
["state.data"] = script:storageLoad("A"),
["it.self"] = script.identity
});
local is_enable = script.config["user.config.1"]
if is_enable.ty == "switch" then
if is_enable.value then
Log:info({
["config"] = "user.config.1",
["enable"] = true
})
else
Log:info({
["config"] = "user.config.1",
["enable"] = false,
["action"] = "好好好"
})
end
end
end
}
}
return ops
end
---@param script ScriptConfig
---@param unityBundle any
---@param manager any
function OperateA(script, unityBundle, manager)
Log:info({ ["entry"] = "Operate A" })
script:storageStore("A", "A");
Log:info({ ["this is"] = script.identity })
Log:info({
["config2.is"] = script.config["user.config.2"].value,
["config2.type"] = script.config["user.config.2"].ty
})
Log:info({ ["data.A"] = script:storageLoad("A") })
end
return module