无题1

1.      FStringClassReference AssetRef("/Game/Blueprints/TPP/BP_TPP_Cube.BP_TPP_Cube_C");
	UClass* Class = AssetRef.ResolveClass();
	if (!Class)
	{
		Class = AssetRef.TryLoadClass<ATPPDynamicActor>();
	}

2. 通过IsNetRelevantFor实现组队等指定条件的网络同步

bool AActor::IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const3.

3. 通过InitNewPlayer解析OpenLevel时传入的?key1=value1?key2=value2的Options

FString AGameModeBase::InitNewPlayer(APlayerController* NewPlayerController, const FUniqueNetIdRepl& UniqueId, const FString& Options, const FString& Portal)

4. visual studio在Development Editor/DebugGame Editor模式下,添加编译选项 -server -port=xxx -log,可以编译出使用未cook资源的服务器,配合ue editor里的客户端调试。当然也可以直接在ue editor里启动多进程的服务器和客户端。

猜你喜欢

转载自blog.csdn.net/taoqilin/article/details/82262178