代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。

原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html



一一四.南瓜灯永不坏(无限使用)

	用MT管理器打开游戏目录/assets/scripts/prefabs/pumpkin_lantern.lua文件,

	1.将共2句inst.components.perishable:StopPerishing()均替换为--inst.components.perishable:StopPerishing()


	2.将下列内容:

	inst:AddComponent("perishable")
	inst.components.perishable:SetPerishTime(30*TUNING.SEG_TIME)
	inst.components.perishable:SetOnPerishFn(onperish)
	inst.components.inventoryitem:SetOnDroppedFn(function(inst)
		inst.components.perishable:StartPerishing()

	替换为:

	--inst:AddComponent("perishable")
	--inst.components.perishable:SetPerishTime(30*TUNING.SEG_TIME)
	--inst.components.perishable:SetOnPerishFn(onperish)
	inst.components.inventoryitem:SetOnDroppedFn(function(inst)
		--inst.components.perishable:StartPerishing()

	即可让南瓜灯无限使用