Class ChildObjectComponent
Helper component for NetworkTransform parenting tests
Inheritance
ChildObjectComponent
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)
Assembly: Unity.Netcode.RuntimeTests.dll
Syntax
public class ChildObjectComponent : NetworkTransform
Fields
ClientInstances
Declaration
public static readonly Dictionary<ulong, NetworkObject> ClientInstances
Field Value
ClientSubChildInstances
Declaration
public static readonly Dictionary<ulong, NetworkObject> ClientSubChildInstances
Field Value
EnableChildLog
Declaration
public static bool EnableChildLog
Field Value
HasSubChild
Declaration
public static bool HasSubChild
Field Value
Instances
Declaration
public static readonly List<ChildObjectComponent> Instances
Field Value
InstancesWithLogging
Declaration
public static readonly List<ChildObjectComponent> InstancesWithLogging
Field Value
ServerAuthority
Declaration
public bool ServerAuthority
Field Value
SubInstances
Declaration
public static readonly List<ChildObjectComponent> SubInstances
Field Value
TestCount
Declaration
public static int TestCount
Field Value
Properties
AuthorityInstance
Declaration
public static ChildObjectComponent AuthorityInstance { get; }
Property Value
AuthoritySubInstance
Declaration
public static ChildObjectComponent AuthoritySubInstance { get; }
Property Value
Methods
IsSubChild()
Declaration
protected virtual bool IsSubChild()
Returns
Invoked just prior to being pushed to non-authority instances.
Declaration
protected override void OnAuthorityPushTransformState(ref NetworkTransform.NetworkTransformState networkTransformState)
Parameters
Overrides
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
OnNetworkDespawn()
Gets called when the NetworkObject gets despawned. Is called both on the server and clients.
Declaration
public override void OnNetworkDespawn()
Overrides
OnNetworkObjectParentChanged(NetworkObject)
Gets called when the parent NetworkObject of this NetworkBehaviour's NetworkObject has changed
Declaration
public override void OnNetworkObjectParentChanged(NetworkObject parentNetworkObject)
Parameters
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
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
Overrides
OnSynchronize<T>(ref BufferSerializer<T>)
This is invoked when a new client joins (server and client sides)
Server Side: Serializes as if we were teleporting (everything is sent via NetworkTransformState)
Client Side: Adds the interpolated state which applies the NetworkTransformState as well
Declaration
protected override void OnSynchronize<T>(ref BufferSerializer<T> serializer) where T : IReaderWriter
Parameters
Type Parameters
Overrides
Reset()
Declaration
public static void Reset()
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.