vault backup: 2024-08-06 15:34:36

This commit is contained in:
BlueRose 2024-08-06 15:34:36 +08:00
parent 68137e7cb0
commit bf54013683

View File

@ -1,2 +1,53 @@
# TsScreenPlayerTextureRenderer
   - MultiViewActor: UE.MultiViewActor;// 用于渲染pvw/pgm画面
1. TsScreenPlayerTextureRenderer
- ReceiveBeginPlay() =>
- this.RegisterLocalEventListener(); =>
- this.ChangeCameraTask(TaskData);
## RegisterLocalEventListener
```ts
private RegisterLocalEventListener(): void {
this.PVWCameraChangeFunc = (TaskData: UE.CamTaskDataRPC) => {
if (this.CurTag == DirectorMode.PVWCameraRenderer) {
this.ChangeCameraTask(TaskData);
}
}
this.PGMCameraChangeFunc = (TaskData: UE.CamTaskDataRPC) => {
if (this.CurTag == DirectorMode.PGMCameraRenderer) {
this.ChangeCameraTask(TaskData);
}
}
this.SwitchDirectorNetTagFunc = (oldTag: UE.GameplayTag, newTag: UE.GameplayTag) => {
this.SwitchDirectorNetTagCallback(oldTag, newTag);
}
DirectorEventSystem.RegisterEventListener(this, DirectorEvent.OnPVWTaskRequested, this.PVWCameraChangeFunc);
DirectorEventSystem.RegisterEventListener(this, DirectorEvent.OnPGMTaskRequested, this.PGMCameraChangeFunc);
DirectorEventSystem.RegisterEventListener(this, DirectorEvent.SwitchDirectorMode, this.SwitchDirectorNetTagFunc)
}
```
## ChangeCameraTask
```ts
ChangeCameraTask(TaskData: UE.CamTaskDataRPC) {
if(!this.bStarted){
return;
}
if(this.DirectorCamManagerActor == null){
this.DirectorCamManagerActor = this.GetCameraManagerActor();
}
// double check
if(this.DirectorCamManagerActor == null){
return;
}
if (this.Task) {
this.Task.Stop();
}
this.Task = DirectorCamUtil.CreateCamTask(this, TaskData, CamTaskType.FullStream, this.DirectorCamManagerActor.droneCamera, null, this.DirectorCamManagerActor.handHeldCamera)
if (this.Task) {
this.Task.Start()
this.BindCamera(this.Task.TryGetBindedMainCamera());
}
}
```