代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
三三九.用猪皮种猪火炬
用MT管理器打开游戏目录/assets/scripts/prefabs/pigskin.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
local function OnDeploy (inst, pt)
SpawnPrefab("pigtorch").Transform:SetPosition(pt.x, pt.y, pt.z)
inst.components.stackable:Get():Remove()
end
inst:AddComponent("deployable")
inst.components.deployable.ondeploy = OnDeploy
即可用猪皮种猪火炬,当主角不与火炬在同一屏时,会生出猪守卫。不要与“霸王盔”一同修改