vault backup: 2024-05-28 10:21:56

This commit is contained in:
BlueRose 2024-05-28 10:21:57 +08:00
parent b99562b8a6
commit cfe9d85eb4

View File

@ -13,9 +13,9 @@
>// 动捕模式下CanSync=false. 各端自行计算Actor Location, client无需使用Server计算结果
// 自由行走模式下, CanSync=trueclient需要同步server的transform信息。
同步Attachment行为。主要是针对 不同角色执行不同的Attachment行为。
在AActor::OnRep_AttachmentReplication()的基础上添加:
同步Attachment行为。在AActor::OnRep_AttachmentReplication()的基础上添加:
```c++
auto CanSync = CanSyncRelativeTransform(); //获取Sync标记具体的逻辑位于TsIdolActor.ts中
if (attachmentReplication.AttachParent)
{
if (RootComponent)
@ -23,7 +23,7 @@
USceneComponent* AttachParentComponent = (attachmentReplication.AttachComponent ? attachmentReplication.AttachComponent : attachmentReplication.AttachParent->GetRootComponent());
if (AttachParentComponent)
{
if(CanSync)
if(CanSync)//增加判断Sync判断只有在自由行走模式下才会同步Transform。
{
RootComponent->SetRelativeLocation_Direct(attachmentReplication.LocationOffset);
RootComponent->SetRelativeRotation_Direct(attachmentReplication.RotationOffset);
@ -45,9 +45,9 @@
}
else
{
BeforeAttachToNewParent();//
BeforeAttachToNewParent();//增加BlueprintNativeEvent
RootComponent->AttachToComponent(AttachParentComponent, FAttachmentTransformRules::KeepRelativeTransform, attachmentReplication.AttachSocket);
AfterAttachToNewParent();
AfterAttachToNewParent();//增加BlueprintNativeEvent
}
}
}