Class WynLobby
Main entry point for WynLobby — a simplified wrapper around Unity MPS Session API. Attach to a persistent GameObject in your scene.
public class WynLobby : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourWynLobby
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.GetComponent<T>()Component.TryGetComponent<T>(out T)Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentInParent<T>()Component.GetComponentsInParent<T>()Component.GetComponents<T>()Component.GetComponentIndex()Component.CompareTag(TagHandle)Component.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.GetEntityId()Object.GetInstanceID()Object.GetHashCode()Object.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object, Vector3, Quaternion, Transform)Object.Instantiate(Object)Object.Instantiate(Object, Scene)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DontDestroyOnLoad(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.FindObjectsByType<T>(FindObjectsSortMode)Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)Object.FindObjectOfType<T>()Object.FindFirstObjectByType<T>()Object.FindAnyObjectByType<T>()Object.FindFirstObjectByType<T>(FindObjectsInactive)Object.FindAnyObjectByType<T>(FindObjectsInactive)Object.ToString()Object.nameObject.hideFlags
Properties
Config
The lobby config asset used by this instance.
public WynLobbyConfig Config { get; }
Property Value
CurrentSession
Current active session, or null if not in a session.
public ISession CurrentSession { get; }
Property Value
- ISession
IsHost
Whether the local player is the host of the current session.
public bool IsHost { get; }
Property Value
IsInSession
Whether the local player is currently in a session.
public bool IsInSession { get; }
Property Value
SessionCode
The join code for the current session, or null.
public string SessionCode { get; }
Property Value
Methods
CreateSessionAsync(string)
Create a new session as host. Internally handles Relay allocation, Lobby creation, and network startup.
public Task<ISession> CreateSessionAsync(string sessionName = null)
Parameters
sessionNamestring
Returns
- Task<ISession>
InitializeAsync()
Initialize Unity Gaming Services and sign in anonymously. Must be called before any session operations.
public Task<bool> InitializeAsync()
Returns
JoinSessionByCodeAsync(string)
Join an existing session by its join code.
public Task<ISession> JoinSessionByCodeAsync(string code)
Parameters
codestring
Returns
- Task<ISession>
JoinSessionByIdAsync(string)
Join an existing session by its session ID (from query results).
public Task<ISession> JoinSessionByIdAsync(string sessionId)
Parameters
sessionIdstring
Returns
- Task<ISession>
LeaveSessionAsync()
Leave the current session.
public Task LeaveSessionAsync()
Returns
QuerySessionsAsync()
Query discoverable sessions. By default, only sessions with available slots are returned.
public Task<QuerySessionsResults> QuerySessionsAsync()
Returns
- Task<QuerySessionsResults>
TryRequestGameStart(string, out string)
Validate and request gameplay start. Runtime only emits an intent event; scene transition is handled by game layer.
public bool TryRequestGameStart(string sceneName, out string reason)