You've already forked Darklings-FightingGame
mirror of
https://github.com/izzy2lost/Darklings-FightingGame.git
synced 2026-03-10 11:35:19 -07:00
31 lines
1.0 KiB
C#
31 lines
1.0 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
using Unity.Services.Authentication;
|
|
using Unity.Services.Core;
|
|
|
|
public class HomeMenu : BaseMenu
|
|
{
|
|
[SerializeField] private TopBarMenu _topBarMenu = default;
|
|
[SerializeField] private PlayerUIRender _playerUIRender = default;
|
|
[SerializeField] private TextMeshProUGUI _playerName = default;
|
|
[SerializeField] private TextMeshProUGUI _playerProfileName = default;
|
|
[SerializeField] private PlayerStatsSO[] _playerStatsSO = default;
|
|
|
|
|
|
async private void Awake()
|
|
{
|
|
await UnityServices.InitializeAsync();
|
|
if (!AuthenticationService.Instance.IsAuthorized)
|
|
await AuthenticationService.Instance.SignInAnonymouslyAsync();
|
|
}
|
|
|
|
public void SetCharacter(int character, int color, string playerName)
|
|
{
|
|
_playerUIRender.gameObject.SetActive(true);
|
|
_playerName.text = playerName;
|
|
_playerProfileName.text = playerName;
|
|
_playerUIRender.SetAnimator(_playerStatsSO[character]._animation);
|
|
_playerUIRender.SetSpriteLibraryAsset(color);
|
|
}
|
|
}
|