36 lines
1.2 KiB
Lua
36 lines
1.2 KiB
Lua
local Action_PlayerRespawn = {
|
||
-- 可配置参数定义,参数将显示在Action配置面板
|
||
-- 例:
|
||
-- MyIntParameter = 0
|
||
PlayerKey = 0;
|
||
}
|
||
|
||
-- 注意:玩家
|
||
function Action_PlayerRespawn:Execute(...)
|
||
-- 先尝试在此处进行设置玩家背包物品,如果不行,
|
||
local Pawn = UGCGameSystem.GetPlayerPawnByPlayerKey(self.PlayerKey)
|
||
local PC = UGCGameSystem.GetPlayerControllerByPlayerKey(self.PlayerKey)
|
||
if UE.IsValid(Pawn) then
|
||
|
||
--PC:EquipSelf();
|
||
Pawn:OnSetSoldierType(UGCGameSystem.GameState.PlayerSoldierType[self.PlayerKey]);
|
||
|
||
-- 通知当前复活了
|
||
UGCSendRPCSystem.ActorRPCNotify(self.PlayerKey, PC, "Client_CanSpectateOthers", 2)
|
||
--UnrealNetwork.CallUnrealRPC(PC, PC, "Client_CanSpectateOthers", 2);
|
||
else
|
||
UGCLogSystem.Log("[Action_PlayerRespawn:Execute] 没有找到 Pawn")
|
||
end
|
||
|
||
return true;
|
||
end
|
||
|
||
--[[
|
||
-- 需要勾选Action的EnableTick,才会执行Update
|
||
-- 触发器激活后,将在每个tick执行Action的Update,直到self.bEnableActionTick为false
|
||
function Action_PlayerRespawn:Update(DeltaSeconds)
|
||
|
||
end
|
||
]]
|
||
|
||
return Action_PlayerRespawn; |