vault backup: 2024-05-28 11:17:28
This commit is contained in:
parent
cfe9d85eb4
commit
427aa43ffa
02-Note/DAWA/ASoul
1
02-Note/DAWA/ASoul/导播台笔记/RuntimeEditor.md
Normal file
1
02-Note/DAWA/ASoul/导播台笔记/RuntimeEditor.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
#
|
@ -14,10 +14,12 @@
|
|||||||
// 自由行走模式下, CanSync=true,client需要同步server的transform信息。
|
// 自由行走模式下, CanSync=true,client需要同步server的transform信息。
|
||||||
|
|
||||||
同步Attachment行为。在AActor::OnRep_AttachmentReplication()的基础上添加:
|
同步Attachment行为。在AActor::OnRep_AttachmentReplication()的基础上添加:
|
||||||
|
- 判断CanSync标记,以此来决定是否同步Transform
|
||||||
|
- 未Attach组件=>Attch组件前后添加BeforeAttachToNewParent()、AfterAttachToNewParent()
|
||||||
```c++
|
```c++
|
||||||
auto CanSync = CanSyncRelativeTransform(); //获取Sync标记,具体的逻辑位于TsIdolActor.ts中
|
auto CanSync = CanSyncRelativeTransform(); //获取Sync标记,具体的逻辑位于TsIdolActor.ts中
|
||||||
if (attachmentReplication.AttachParent)
|
if (attachmentReplication.AttachParent)
|
||||||
{
|
{
|
||||||
if (RootComponent)
|
if (RootComponent)
|
||||||
{
|
{
|
||||||
USceneComponent* AttachParentComponent = (attachmentReplication.AttachComponent ? attachmentReplication.AttachComponent : attachmentReplication.AttachParent->GetRootComponent());
|
USceneComponent* AttachParentComponent = (attachmentReplication.AttachComponent ? attachmentReplication.AttachComponent : attachmentReplication.AttachParent->GetRootComponent());
|
||||||
@ -51,12 +53,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
# TsIdolActor.ts
|
# TsIdolActor.ts
|
||||||
## VirtualOverrider
|
## VirtualOverrider
|
||||||
|
CanSyncRelativeTransform()
|
||||||
|
- 不需要同步Transform的情况
|
||||||
|
- AI控制的ACao角色不需要同步。
|
||||||
|
- 使用TsIdolMovementComponent并且勾选了ManulMovement的情况不需要同步。
|
||||||
|
- 动画蓝图中使用了**AnimGraphNode_Fullbody**节点,并且bGetMotionData为true的情况不需要同步。
|
||||||
|
|
||||||
|
具体代码如下:
|
||||||
```typescript
|
```typescript
|
||||||
CanSyncRelativeTransform(): boolean {
|
CanSyncRelativeTransform(): boolean {
|
||||||
if (Utils.HasTag(this.PropTags, new UE.GameplayTag("Idol.AIACao"))) {
|
if (Utils.HasTag(this.PropTags, new UE.GameplayTag("Idol.AIACao"))) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user