探索
看看角色走到 front end 发生了什么
当角色触碰到 光效的时候会走到这里
先看看谁碰的我 是pawn的话继续往下走
如果pawn的controller合法 如果这个pawn是local player controller调用 load into experience方法
了解一下 什么是local player controller
FORCEINLINE_DEBUGGABLE bool AController::IsLocalPlayerController() const
{
return IsPlayerController() && IsLocalController();
}
是playercontroller 并且是 localcontroller
那什么是 localcontroller呢
bool AController::IsLocalController() const
{
const ENetMode NetMode = GetNetMode();
if (NetMode == NM_Standalone)
{
// Not networked.
return true;
}
if (NetMode == NM_Client && GetLocalRole() == ROLE_AutonomousProxy)
{
// Networked client in control.
return true;
}
if (GetRemoteRole() != ROLE_AutonomousProxy && GetLocalRole() == ROLE_Authority)
{
// Local authority in control.
return true;
}
return false;
}
如果是standalone模式 则必定是localcontroller
如果是客户端并且localrole是ROLE_AutonomousProxy
意思是 你玩一个角色 同时 还有其他玩家和你一起玩, 那么你电脑上 ,你操作的角色就是ROLE_AutonomousProxy 你电脑上的其他玩家就是ROLE_SimulatedProxy
如果是服务器 并且localrole是ROLE_Authority
好说回lyra