docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct NetworkBehaviourReference

    A helper struct for serializing NetworkBehaviours over the network. Can be used in RPCs and NetworkVariable<T>. Note: network ids get recycled by the NetworkManager after a while. So a reference pointing to

    Implements
    INetworkSerializable
    IEquatable<NetworkBehaviourReference>
    Inherited Members
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.Netcode
    Assembly: solution.dll
    Syntax
    public struct NetworkBehaviourReference : INetworkSerializable, IEquatable<NetworkBehaviourReference>

    Constructors

    Name Description
    NetworkBehaviourReference(NetworkBehaviour)

    Creates a new instance of the NetworkBehaviourReference<T> struct.

    Methods

    Name Description
    Equals(object)

    Indicates whether this instance and a specified object are equal.

    Equals(NetworkBehaviourReference)

    Indicates whether the current object is equal to another object of the same type.

    GetHashCode()

    Returns the hash code for this instance.

    NetworkSerialize<T>(BufferSerializer<T>)

    Provides bi-directional serialization to read and write the desired data to serialize this type.

    TryGet(out NetworkBehaviour, NetworkManager)

    Tries to get the NetworkBehaviour referenced by this reference.

    TryGet<T>(out T, NetworkManager)

    Tries to get the NetworkBehaviour referenced by this reference.

    Operators

    Name Description
    implicit operator NetworkBehaviourReference(NetworkBehaviour)

    Implicitly convert NetworkBehaviour to NetworkBehaviourReference.

    implicit operator NetworkBehaviour(NetworkBehaviourReference)

    Implicitly convert NetworkBehaviourReference to NetworkBehaviour.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)