vault backup: 2024-05-28 10:21:56
This commit is contained in:
parent
b99562b8a6
commit
cfe9d85eb4
@ -13,9 +13,9 @@
|
||||
>// 动捕模式下,CanSync=false. 各端自行计算Actor Location, client无需使用Server计算结果
|
||||
// 自由行走模式下, CanSync=true,client需要同步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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user