UDN
Search public documentation:
ReplicationTornOffCH
English Translation
日本語訳
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
日本語訳
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
脱离模式
概述
当您想停止复制一个actor的相关信息时使用该模式。服务器将不会复制脱离的actor到之后加入的新客户端中。当actor从网络脱离时,将会执行TornOff事件。
Pawns
虚幻竞技场中的pawns使用了该模式,尤其是当pawns死亡时。当pawn死亡时,pawns通常要播放死亡动画或变成物理对象。在那期间,就不必复制任何信息到客户端了。
simulated event TornOff() { // assume dead if bTearOff if (!bPlayedDeath) { PlayDying(HitDamageType,TakeHitLocation); } } simulated function PlayDying(class<DamageType> DamageType, vector HitLoc) { GotoState('Dying'); bReplicateMovement = false; bTearOff = true; Velocity += TearOffMomentum; SetDyingPhysics(); bPlayedDeath = true; KismetDeathDelayTime = default.KismetDeathDelayTime + WorldInfo.TimeSeconds; }
结论
当您想让服务器停止向客户端上的actors复制信息并且这些actor可以在客户端上进行完全仿真不会导致任何仿真问题时使用该模式, 除pawn死亡时使用该模式外,可以应用的该模式的其他情况有:
- 如果射弹可以由玩家控制一段固定时间,当该时间段过后玩家失去对射弹的控制,那么此情况可以使用该模式。
- 如果需要将客户端效果持续复制一段固定时间,那么可以使用该模式。