Class NetworkTransformTestComponent
Helper component for all NetworkTransformTests
Inheritance
Inherited Members
Namespace: Unity.Netcode.RuntimeTests
Assembly: Unity.Netcode.RuntimeTests.dll
Syntax
public class NetworkTransformTestComponent : NetworkTransform
Fields
AuthorityInstance
Declaration
public static NetworkTransformTestComponent AuthorityInstance
Field Value
Type | Description |
---|---|
Network |
AuthorityLastSentState
Declaration
public NetworkTransform.NetworkTransformState AuthorityLastSentState
Field Value
Type | Description |
---|---|
Network |
AuthorityMove
Declaration
public bool AuthorityMove
Field Value
Type | Description |
---|---|
bool |
DirectionToMove
Declaration
public Vector3 DirectionToMove
Field Value
Type | Description |
---|---|
Vector3 |
MoveSpeed
Declaration
public float MoveSpeed
Field Value
Type | Description |
---|---|
float |
ReadyToReceivePositionUpdate
Declaration
public bool ReadyToReceivePositionUpdate
Field Value
Type | Description |
---|---|
bool |
ServerAuthority
Declaration
public bool ServerAuthority
Field Value
Type | Description |
---|---|
bool |
Properties
StatePushed
Declaration
public bool StatePushed { get; }
Property Value
Type | Description |
---|---|
bool |
StateUpdated
Declaration
public bool StateUpdated { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
ApplyState()
Declaration
public (bool isDirty, bool isPositionDirty, bool isRotationDirty, bool isScaleDirty) ApplyState()
Returns
Type | Description |
---|---|
(bool is |
CommitToTransform()
Declaration
public void CommitToTransform()
OnAuthorityPushTransformState(ref NetworkTransformState)
Invoked just prior to being pushed to non-authority instances.
Declaration
protected override void OnAuthorityPushTransformState(ref NetworkTransform.NetworkTransformState networkTransformState)
Parameters
Type | Name | Description |
---|---|---|
Network |
networkTransformState | the state being pushed |
Overrides
Remarks
This is useful to know the exact position, rotation, or scale values sent to non-authoritative instances. This is only invoked on the authoritative instance.
OnIsServerAuthoritative()
Override this method and return false to switch to owner authoritative mode
Declaration
protected override bool OnIsServerAuthoritative()
Returns
Type | Description |
---|---|
bool | (true or false) where when false it runs as owner-client authoritative |
Overrides
OnNetworkSpawn()
Gets called when the Network
Declaration
public override void OnNetworkSpawn()
Overrides
OnNetworkTransformStateUpdated(ref NetworkTransformState, ref NetworkTransformState)
Invoked on the non-authoritative side when the NetworkTransformState has been updated
Declaration
protected override void OnNetworkTransformStateUpdated(ref NetworkTransform.NetworkTransformState oldState, ref NetworkTransform.NetworkTransformState newState)
Parameters
Type | Name | Description |
---|---|---|
Network |
oldState | the previous Network |
Network |
newState |
Overrides
Update()
Declaration
protected override void Update()
Overrides
Remarks
If you override this method, be sure that:
- Non-authority always invokes this base class method.
Events
AuthorityPushedTransformState
Declaration
public event NetworkTransformTestComponent.AuthorityPushedTransformStateDelegateHandler AuthorityPushedTransformState
Event Type
NonAuthorityReceivedTransformState
Declaration
public event NetworkTransformTestComponent.NonAuthorityReceivedTransformStateDelegateHandler NonAuthorityReceivedTransformState