106 lines
4.4 KiB
Lua
106 lines
4.4 KiB
Lua
ObjectPath = {};
|
|
|
|
-- 在前面加上工程名就是这个 /TrainingCamp/Asset/Blueprint/UGCPlayerPawn.UGCPlayerPawn_C
|
|
|
|
ObjectPath.ActorClassPath = {
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/UGCPlayerPawn.UGCPlayerPawn_C'),
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/SceneObj/Start/BP_ActorStart.BP_ActorStart_C'),
|
|
'/Game/BluePrints/Environment/BP_radiation.BP_radiation_C',
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/Blueprint/SceneObj/Start/BP_PlayerStartBase.BP_PlayerStartBase_C'),
|
|
|
|
'/Game/UGC/Skill/Skill_DetectPlayer/BP_DetectPlayerActor.BP_DetectPlayerActor_C',
|
|
};
|
|
if not UE_SERVER then
|
|
ObjectPath.ClientClassPath = {
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Child/WB_PlayerInfoItem.WB_PlayerInfoItem_C'),
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Child/WB_PlayerInfoItem_Small.WB_PlayerInfoItem_Small_C'),
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tool/WB_SelectPartItem.WB_SelectPartItem_C'),
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/Tool/WB_SelectPartButton.WB_SelectPartButton_C'),
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapons/Child/WB_AllWeapon_Type.WB_AllWeapon_Type_C'),
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapons/Child/WB_AllWeapon_Item.WB_AllWeapon_Item_C'),
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapons/Child/WB_SelectWeaponItems.WB_SelectWeaponItems_C'),
|
|
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/UI/SelectWeapons/Child/WB_BoltItem.WB_BoltItem_C'),
|
|
};
|
|
--- 需要加载 Object 的类
|
|
ObjectPath.ActorObjectPath = {
|
|
'/Game/Arts_Effect/ParticleSystems/Share/P_AH6_baozha_01.P_AH6_baozha_01', -- 爆炸特效
|
|
'/Game/UGC/Effect/particleSystems/model/particle/P_bonfire_01.P_bonfire_01', -- 燃烧特效
|
|
'/Game/Arts_Player/Characters/Animation/Shared_Anim/Lobby_Anim/Dance/SS15/Effect/SaoLuoC/P_Implosive.P_Implosive', -- 冷冻特效
|
|
'/Game/Arts_Timeliness/GameMode/InfectionTDM2/Arts_Effect/P_TDM2_Absorb_01.P_TDM2_Absorb_01', -- 冷冻特效
|
|
'/Game/Arts_Timeliness/GameMode/TeamCompetition/CG010/Arts_Effect/P_Speed.P_Speed', -- 加速
|
|
'/Game/Arts_Effect/ParticleSystems/Hero/P_MedicSoldier_djf01.P_MedicSoldier_djf01', -- 回血
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/Art/FX/P_Fire.P_Fire'),
|
|
'/Game/Arts_Effect/ParticleSystems/FX_PVE/P_Zombie6_Skill_02.P_Zombie6_Skill_02', -- 毒伤
|
|
UGCGameSystem.GetUGCResourcesFullPath('Asset/Art/FX/P_TDM2_lnfectedMan_05.P_TDM2_lnfectedMan_05'),
|
|
|
|
'/Game/Arts_Effect/ParticleSystems/Share/P_Birthisland_hold_02.P_Birthisland_hold_02',
|
|
|
|
--- 音效
|
|
'/Game/WwiseEvent/Weapon_Player/RPG/Play_RPG_Explosion.Play_RPG_Explosion',
|
|
};
|
|
end
|
|
|
|
|
|
function ObjectPath.Init()
|
|
for i, v in pairs(ObjectPath.ActorClassPath) do
|
|
local dot_num = string.find(v, '%.');
|
|
local val = string.sub(v, dot_num + 1, string.len(v) - 2);
|
|
UE.AsyncLoadClass(v, function(TargetClass)
|
|
ObjectPath[val] = TargetClass;
|
|
if ObjectPath.WaitFuncs[val] then
|
|
for c, d in pairs(ObjectPath.WaitFuncs[val]) do
|
|
d(TargetClass);
|
|
end
|
|
ObjectPath.WaitFuncs[val] = nil;
|
|
end
|
|
end);
|
|
end
|
|
if UE_SERVER then
|
|
else
|
|
for i, v in pairs(ObjectPath.ClientClassPath) do
|
|
local dot_num = string.find(v, '%.');
|
|
local val = string.sub(v, dot_num + 1, string.len(v) - 2);
|
|
UE.AsyncLoadClass(v, function(TargetClass)
|
|
ObjectPath[val] = TargetClass;
|
|
if ObjectPath.WaitFuncs[val] then
|
|
for c, d in pairs(ObjectPath.WaitFuncs[val]) do
|
|
d(TargetClass);
|
|
end
|
|
ObjectPath.WaitFuncs[val] = nil;
|
|
end
|
|
end);
|
|
end
|
|
for i, v in pairs(ObjectPath.ActorObjectPath) do
|
|
local dot_num = string.find(v, '%.');
|
|
local val = string.sub(v, dot_num + 1, string.len(v));
|
|
UE.AsyncLoadObject(v, function(TargetObject)
|
|
ObjectPath[val] = TargetObject;
|
|
if ObjectPath.WaitFuncs[val] then
|
|
for c, d in pairs(ObjectPath.WaitFuncs[val]) do
|
|
d(TargetObject);
|
|
end
|
|
ObjectPath.WaitFuncs[val] = nil;
|
|
end
|
|
end);
|
|
end
|
|
end
|
|
end
|
|
|
|
ObjectPath.WaitFuncs = {};
|
|
|
|
---@param Func fun(Target:UClass)
|
|
function ObjectPath.AddFunc(InClassName, Func)
|
|
UGCLogSystem.Log("[ObjectPath.AddFunc] 开始添加 %s", InClassName);
|
|
if ObjectPath[InClassName] then
|
|
Func(ObjectPath[InClassName]);
|
|
else
|
|
if ObjectPath.WaitFuncs[InClassName] == nil then
|
|
ObjectPath.WaitFuncs[InClassName] = {};
|
|
end
|
|
table.insert(ObjectPath.WaitFuncs[InClassName], Func);
|
|
UGCLogSystem.LogTree(string.format("[ObjectPath.AddFunc] ObjectPath.WaitFuncs ="), ObjectPath.WaitFuncs)
|
|
end
|
|
end
|
|
|
|
return ObjectPath; |