Zef Wang Posted August 12, 2024 Share Posted August 12, 2024 local assets = { Asset("ANIM", "anim/unit.zip"), --地上的动画 Asset("ATLAS", "images/inventoryimages/unit_cal.xml"), --加载物品栏贴图 Asset("IMAGE", "images/inventoryimages/unit_cal.tex"), Asset("IMAGE", "images/inventoryimages/unit_com.xml"), Asset("IMAGE", "images/inventoryimages/unit_com.tex"), Asset("IMAGE", "images/inventoryimages/unit_war.xml"), Asset("IMAGE", "images/inventoryimages/unit_war.tex"), } local function commonfn(anim, tag) local inst = CreateEntity() inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() MakeInventoryPhysics(inst) inst.AnimState:SetBank("unit") --地上动画 inst.AnimState:SetBuild("unit") inst.AnimState:PlayAnimation(anim) if tag ~= nil then inst:AddTag("units") end MakeInventoryFloatable(inst, "med", nil, 0.6) inst.entity:SetPristine() if not TheWorld.ismastersim then return inst end -- 可检查组件 inst:AddComponent("inspectable") inst:AddComponent("stackable") inst:AddComponent("inventoryitem") -- 添加物品组件 inst.components.inventoryitem.atlasname = "images/inventoryimages/unit_" .. anim .. ".xml" -- 确保物品贴图路径正确 MakeHauntableLaunch(inst) return inst end local function unit_purple() return commonfn("cal", nil) end local function unit_blue() return commonfn("com", nil) end local function unit_red() return commonfn("war", nil) end return Prefab("unit_calculate", unit_purple, assets), Prefab("unit_comparison", unit_blue, assets), Prefab("unit_weapon", unit_red, assets) Ask for advice, either in English or Chinese is okay. Link to comment https://forums.kleientertainment.com/forums/topic/158999-help-in-the-items-prefab-file-inventoryimages-did-not-load-successfully/ Share on other sites More sharing options...
Rickzzs Posted August 13, 2024 Share Posted August 13, 2024 ATLAS和IMAGE Link to comment https://forums.kleientertainment.com/forums/topic/158999-help-in-the-items-prefab-file-inventoryimages-did-not-load-successfully/#findComment-1740441 Share on other sites More sharing options...
Zef Wang Posted August 13, 2024 Author Share Posted August 13, 2024 9 hours ago, Rickzzs said: ATLAS和IMAGE unit_cal.tex unit_cal.xml unit_com.tex unit_com.xml unit_war.tex unit_war.xml Link to comment https://forums.kleientertainment.com/forums/topic/158999-help-in-the-items-prefab-file-inventoryimages-did-not-load-successfully/#findComment-1740493 Share on other sites More sharing options...
Zef Wang Posted September 11, 2024 Author Share Posted September 11, 2024 The problem has fixed by myself so far : ) Link to comment https://forums.kleientertainment.com/forums/topic/158999-help-in-the-items-prefab-file-inventoryimages-did-not-load-successfully/#findComment-1747125 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now