代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
五十一.种草不用施肥
用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/grass.lua文件,
1.将下列内容:
local function ontransplantfn(inst)
if inst.components.pickable then
inst.components.pickable:MakeBarren()
end
end
替换为:
local function ontransplantfn(inst)
--if inst.components.pickable then
--inst.components.pickable:MakeBarren()
--end
end
2.在local function onpickedfn(inst)的下一行插入以下内容:
inst.components.pickable.cycles_left = 20
即可种草不用施肥