代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
1
2八十八.蜂箱快速产蜂蜜
3
4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/beebox.lua文件,
5
6 1.将下列内容:
7
8 inst.components.harvestable:SetGrowTime(TUNING.BEEBOX_HONEY_TIME)
9 inst.components.harvestable:StartGrowing()
10 end
11 end
12end
13
14local function stopsleep(inst)
15 if not inst:HasTag("burnt") then
16 if inst.components.harvestable then
17 inst.components.harvestable:SetGrowTime(nil)
18 inst.components.harvestable:StopGrowing()
19
20 替换为:
21
22 inst.components.harvestable:SetGrowTime(TUNING.BEEBOX_HONEY_TIME*.01)
23 inst.components.harvestable:StartGrowing()
24 end
25 end
26end
27
28local function stopsleep(inst)
29 if not inst:HasTag("burnt") then
30 if inst.components.harvestable then
31 inst.components.harvestable:SetGrowTime(TUNING.BEEBOX_HONEY_TIME*.01)
32 inst.components.harvestable:StartGrowing()
33
34
35 2.将inst:ListenForEvent( "dusktime", StopSpawningFn(inst), GetWorld())替换为inst:ListenForEvent( "dusktime", StartSpawningFn(inst), GetWorld())
36
37 即可让蜂箱快速产蜂蜜,几秒钟一箱就满了