Chuyển tới nội dung chính

IProjectVAuthenticatedSceneGate interface

Guards scenes that need a signed-in player. A scene checks IsReady; when it is false, it saves itself with RequestReturnTo and opens Login. After sign-in, Login opens the scene from ConsumeReturnScene. You load the scenes; the gate only remembers where to go.

Namespace: SilverTiger.ProjectV.Unity.Presentation.Authentication

public interface IProjectVAuthenticatedSceneGate

Properties​

PropertyTypeDescription
IsReadyboolTrue when a player is signed in and the game data is ready, so the scene can open.

Methods​

RequestReturnTo(string sceneName)​

Remembers the scene to open after the next sign-in. A later call replaces it.

void RequestReturnTo(string sceneName);

Parameters

NameTypeDescription
sceneNamestringThe scene name to return to; must not be null or blank.

Exceptions

ExceptionWhen
ArgumentExceptionsceneName is null or blank.

ConsumeReturnScene(string fallbackSceneName)​

Returns the remembered scene and forgets it, so it is used only once.

string ConsumeReturnScene(string fallbackSceneName);

Parameters

NameTypeDescription
fallbackSceneNamestringThe scene to open when none is remembered, such as the Lobby; must not be null or blank.

Returns

string: The remembered scene name, or fallbackSceneName when none is remembered.

Exceptions

ExceptionWhen
ArgumentExceptionfallbackSceneName is null or blank.

ClearReturnScene()​

Forgets the remembered scene, for example when the player signs out.

void ClearReturnScene();