docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method TryGet

    TryGet(out NetworkBehaviour, NetworkManager)

    Tries to get the NetworkBehaviour referenced by this reference.

    Declaration
    public bool TryGet(out NetworkBehaviour networkBehaviour, NetworkManager networkManager = null)
    Parameters
    Type Name Description
    NetworkBehaviour networkBehaviour

    The NetworkBehaviour which was found. Null if the corresponding NetworkObject was not found.

    NetworkManager networkManager

    The networkmanager. Uses Singleton to resolve if null.

    Returns
    Type Description
    bool

    True if the NetworkBehaviour was found; False if the NetworkBehaviour was not found. This can happen if the corresponding NetworkObject has not been spawned yet. you can try getting the reference at a later point in time.

    TryGet<T>(out T, NetworkManager)

    Tries to get the NetworkBehaviour referenced by this reference.

    Declaration
    public bool TryGet<T>(out T networkBehaviour, NetworkManager networkManager = null) where T : NetworkBehaviour
    Parameters
    Type Name Description
    T networkBehaviour

    The NetworkBehaviour which was found. Null if the corresponding NetworkObject was not found.

    NetworkManager networkManager

    The networkmanager. Uses Singleton to resolve if null.

    Returns
    Type Description
    bool

    True if the NetworkBehaviour was found; False if the NetworkBehaviour was not found. This can happen if the corresponding NetworkObject has not been spawned yet. you can try getting the reference at a later point in time.

    Type Parameters
    Name Description
    T

    The type of the networkBehaviour for convenience.

    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)