Class NetworkTransformTestComponent
Helper component for all NetworkTransformTests
Inheritance
NetworkTransformTestComponent
Inherited Members
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: Unity.Netcode.RuntimeTests
Assembly: solution.dll
Syntax
public class NetworkTransformTestComponent : NetworkTransform
Fields
AuthorityInstance
Declaration
public static NetworkTransformTestComponent AuthorityInstance
Field Value
Type | Description |
---|---|
NetworkTransformTestComponent |
AuthorityLastSentState
Declaration
public NetworkTransform.NetworkTransformState AuthorityLastSentState
Field Value
Type | Description |
---|---|
NetworkTransform.NetworkTransformState |
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 isDirty, bool isPositionDirty, bool isRotationDirty, bool isScaleDirty) |
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 |
---|---|---|
NetworkTransform.NetworkTransformState | 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 NetworkObject gets spawned, message handlers are ready to be registered and the network is setup.
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 |
---|---|---|
NetworkTransform.NetworkTransformState | oldState | the previous NetworkTransform.NetworkTransformState |
NetworkTransform.NetworkTransformState | newState |
Overrides
Events
AuthorityPushedTransformState
Declaration
public event NetworkTransformTestComponent.AuthorityPushedTransformStateDelegateHandler AuthorityPushedTransformState
Event Type
Type | Description |
---|---|
NetworkTransformTestComponent.AuthorityPushedTransformStateDelegateHandler |