2022-12-08 19:44:01 +02:00
|
|
|
using Unity.Services.Authentication;
|
|
|
|
|
using Unity.Services.Core;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class OnlineMainMenu : BaseMenu
|
|
|
|
|
{
|
|
|
|
|
[SerializeField] private GameObject _connectingGroup = default;
|
|
|
|
|
[SerializeField] private GameObject _connectedGroup = default;
|
2023-03-18 11:54:03 +02:00
|
|
|
[SerializeField] private OnlineSetupMenu _onlineSetupMenu = default;
|
|
|
|
|
[SerializeField] private DemonNameplate _demonNameplate = default;
|
2022-12-08 19:44:01 +02:00
|
|
|
|
|
|
|
|
async void Awake()
|
|
|
|
|
{
|
|
|
|
|
await UnityServices.InitializeAsync();
|
|
|
|
|
AuthenticationService.Instance.SignedIn += () =>
|
|
|
|
|
{
|
|
|
|
|
_connectingGroup.SetActive(false);
|
|
|
|
|
_connectedGroup.SetActive(true);
|
|
|
|
|
};
|
|
|
|
|
await AuthenticationService.Instance.SignInAnonymouslyAsync();
|
|
|
|
|
}
|
2023-03-18 11:54:03 +02:00
|
|
|
|
|
|
|
|
private void OnEnable()
|
|
|
|
|
{
|
2023-03-27 23:57:47 +03:00
|
|
|
_demonNameplate.transform.parent.gameObject.SetActive(true);
|
2023-03-18 11:54:03 +02:00
|
|
|
_demonNameplate.SetDemonData(_onlineSetupMenu.DemonData);
|
|
|
|
|
}
|
2023-03-27 23:57:47 +03:00
|
|
|
}
|