YN099-养殖大象(用兔人尾巴种大象)
代码来源于“易宁”大佬的分享,仅供学习,不要直接复制粘贴。 原帖链接:http://bbs.3dmgame.com/thread-3859071-1-1.html 九十九.养殖大象(用兔人尾巴种大象) 用MT管理器打开游戏目录/assets/DLC0002/scripts/prefabs/manrabbit_tail.lua文件,在inst:AddComponent("inspectable")的下一行插入以下内容: local function OnDeploy (inst, pt) local names = {"koalefant_summer","koalefant_winter"} inst.name = names[math.random(#names)] SpawnPrefab(inst.name).Transform:SetPosition(pt.x, pt.y, pt.z) inst.components.stackable:Get():Remove() end inst:AddComponent("deployable") inst.components.deployable.ondeploy = OnDeploy 即可用兔人尾巴种大象,品种随机,可能是冬象、也可能是夏象