代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。
原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html
1
2四十六.树桩继续长成树
3
4 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/evergreens.lua文件,
5
6 1.将下列内容:
7
8local function chop_down_tree(inst, chopper)
9 inst:RemoveComponent("burnable")
10 MakeSmallBurnable(inst)
11 inst:RemoveComponent("propagator")
12 MakeSmallPropagator(inst)
13 inst:RemoveComponent("workable")
14
15 替换为:
16
17 MakeLargeBurnable(inst)
18 MakeLargePropagator(inst)
19
20
21 2.将下列内容:
22
23 RemovePhysicsColliders(inst)
24 inst.AnimState:PushAnimation(inst.anims.stump)
25
26 inst:AddComponent("workable")
27 inst.components.workable:SetWorkAction(ACTIONS.DIG)
28 inst.components.workable:SetOnFinishCallback(dig_up_stump)
29 inst.components.workable:SetWorkLeft(1)
30
31 inst:AddTag("stump")
32 if inst.components.growable then
33 inst.components.growable:StopGrowing()
34 end
35
36 替换为:
37
38 inst.AnimState:PushAnimation(inst.anims.stump)
39
40 即可让树桩继续长成树,取消用铲子挖树桩,如果不想要树桩了,烧掉即可。注意这种再生树不会烧成枯树,烧完只会剩一团灰。不要与“砍树无树桩”一同修改