docs.unity3d.com
    Show / Hide Table of Contents

    Class PresenceManager

    Provides a way to get Room instances based off an Id and implement ISessionProvider to use on other services.

    Inheritance
    Object
    PresenceManager
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unity.Cloud.Presence.Runtime
    Syntax
    public class PresenceManager : IRoomProvider<Room>, ISessionProvider

    Constructors

    PresenceManager(IServiceMessagingClient, IServiceMessagingClient, IServiceHostResolver, ServiceProtocol)

    Initializes and returns an instance of PresenceManager

    Declaration
    public PresenceManager(IServiceMessagingClient monitorClient, IServiceMessagingClient joinClient, IServiceHostResolver serviceHostResolver, ServiceProtocol serviceProtocol = ServiceProtocol.WebSocketSecure)
    Parameters
    Type Name Description
    IServiceMessagingClient monitorClient

    The IServiceMessagingClient to be used for RoomMonitoring

    IServiceMessagingClient joinClient

    The IServiceMessagingClient to be used for RoomJoiner

    IServiceHostResolver serviceHostResolver

    The IServiceHostResolver to be used for resolving the service address.

    ServiceProtocol serviceProtocol

    The ServiceProtocol for resolving the service address.

    Properties

    Session

    Indicates in the current session if the local participant has joined.

    Declaration
    public ISession Session { get; }
    Property Value
    Type Description
    ISession
    Implements
    ISessionProvider.Session

    Methods

    GetRoomAsync(SceneId)

    Returns a room instance given a SceneId.

    Declaration
    public Task<Room> GetRoomAsync(SceneId id)
    Parameters
    Type Name Description
    SceneId id

    The SceneId associated to the room

    Returns
    Type Description
    Task<Room>

    A room instance

    Implements
    IRoomProvider<TRoom>.GetRoomAsync(SceneId)

    GetRoomAsync(RoomId)

    Returns a room instance given a RoomId.

    Declaration
    public Task<Room> GetRoomAsync(RoomId id)
    Parameters
    Type Name Description
    RoomId id

    The RoomId of the room

    Returns
    Type Description
    Task<Room>

    A room instance

    Implements
    IRoomProvider<TRoom>.GetRoomAsync(RoomId)

    Events

    SessionChanged

    Calls the methods in its invocation list when the session changes. Returns Null if the participant left the session.

    Declaration
    public event Action<ISession> SessionChanged
    Event Type
    Type Description
    Action<ISession>
    Implements
    ISessionProvider.SessionChanged

    Extension Methods

    GenericDataExtensions.SerializeToByteArray(Object)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023