LobbyIDMethod
Namespace: SynicSugar.MatchMake
Class: MatchMakeManager
LobbyIDMethod lobbyIDMethod
Description
The Actions to save and delete LobbyID currently belonging.
We use this for the way to save and delete LobbyID that have no return value.
If we don't use Register(Action save, Action delete, bool changeType = true) to add the events, need switch lobbyIdSaveType to CustomMethod.
If set customSaveLobbyID on editor, this is registered on Awake automatically.
Save is called when matchmaking is complete. In other words, Lobby is filled and the matchmaking is closed, then call Save.
Delete is called on the last of ConnectHub ExitSession or CloseSession. If user disconnect the session in any other way, SynicSugar determined that the user needs to be reconnected.
Properity
API | description |
---|---|
Save | Event to save LobbyID to reconnect Lobby. |
Delete | Event to save LobbyID to reconnect Lobby. |
Function
API | description |
---|---|
Register | Set events and switch lobbyIdSaveType |
using SynicSugar.MatchMake;
public class MatchMake {
void SetMatchMakeCondition(){
//Use api (this switch type automatically)
MatchMakeManager.Instance.lobbyIDMethod.Register(() => SaveMethod(), () => DeleteMethod());
//Standard event way and change type
MatchMakeManager.Instance.lobbyIDMethod.Save += () => SaveMethod();
MatchMakeManager.Instance.lobbyIDMethod.Delete += () => DeleteMethod();
MatchMakeManager.Instance.lobbyIdSaveType = MatchMakeManager.RecconectLobbyIdSaveType.CustomMethod;
}
void SaveMethod(){
}
void DeleteMethod(){
}
}