代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
1
2六十五.铲掉洞穴花得荧光果
3
4 用MT管理器打开游戏目录/assets/scripts/prefabs/flower_cave.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容:
5
6local function dig_up(inst, chopper)
7 inst.components.lootdropper:SpawnLootPrefab("lightbulb")
8 inst:Remove()
9end
10 inst:AddComponent("workable")
11 inst.components.workable:SetWorkAction(ACTIONS.DIG)
12 inst.components.workable:SetOnFinishCallback(dig_up)
13 inst.components.workable:SetWorkLeft(1)
14
15 即可用铲子铲掉洞穴花得荧光果,使洞穴花可以被移除