代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
1
2一一四.南瓜灯永不坏(无限使用)
3
4 用MT管理器打开游戏目录/assets/scripts/prefabs/pumpkin_lantern.lua文件,
5
6 1.将共2句inst.components.perishable:StopPerishing()均替换为--inst.components.perishable:StopPerishing()
7
8
9 2.将下列内容:
10
11 inst:AddComponent("perishable")
12 inst.components.perishable:SetPerishTime(30*TUNING.SEG_TIME)
13 inst.components.perishable:SetOnPerishFn(onperish)
14 inst.components.inventoryitem:SetOnDroppedFn(function(inst)
15 inst.components.perishable:StartPerishing()
16
17 替换为:
18
19 --inst:AddComponent("perishable")
20 --inst.components.perishable:SetPerishTime(30*TUNING.SEG_TIME)
21 --inst.components.perishable:SetOnPerishFn(onperish)
22 inst.components.inventoryitem:SetOnDroppedFn(function(inst)
23 --inst.components.perishable:StartPerishing()
24
25 即可让南瓜灯无限使用