-
Notifications
You must be signed in to change notification settings - Fork 12
GameService
VirtueSky edited this page Sep 8, 2024
·
7 revisions
- Game service is tools support sign in
With Apple Id
andGoogle Play Game Service
- Attach
GooglePlayGamesAuthentication
(for Android) andAppleAuthentication
(for iOS) to scene
- Open tab
GameService
inMagic Panel
to install library and add define symbols
- Demo script
public EventNoParam loginEvent;
public StatusLoginVariable statusLoginVariable;
public StringVariable serverCodeVariable;
private void OnEnable()
{
statusLoginVariable.AddListener(OnStatusLoginChange);
}
private void OnStatusLoginChange(StatusLogin obj)
{
switch (statusLoginVariable.Value)
{
case StatusLogin.Successful:
Debug.Log("login successful");
break;
case StatusLogin.Failed:
Debug.Log("login failed");
break;
}
}
[Button]
public void Login()
{
loginEvent.Raise();
}
- After calling
Login
,statusLoginVariable
changes value-
Successful
: Login successful andserverCodeVariable
has value -
Failed
: Login failed andserverCodeVariable
is empty
-