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

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



三六0.无限刷洞穴(用石砖种洞穴入口,用铲子可挖掉洞穴入口)

	1.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/cutstone.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:

local function OnDeploy (inst, pt)
	SpawnPrefab("cave_entrance").Transform:SetPosition(pt.x, pt.y, pt.z)
	inst.components.stackable:Get():Remove()
end
	inst:AddComponent("deployable")
	inst.components.deployable.ondeploy = OnDeploy


	2.用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/cave_entrance.lua文件,将inst:RemoveComponent("workable")替换为以下内容:

local function dig_up(inst, chopper)
	inst:Remove()
end
	inst:AddComponent("workable")
	inst.components.workable:SetWorkAction(ACTIONS.DIG)
	inst.components.workable:SetOnFinishCallback(dig_up)
	inst.components.workable:SetWorkLeft(1)

	即可无限刷洞穴,在地面用石砖种洞穴入口将下到洞穴层,在洞穴层用石砖种洞穴入口将下到远古层,注意不要在远古层再种洞穴入口了。不需要该洞穴时,用铲子将洞口铲掉即可