You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using System;
|
|
using Unity.BossRoom.Gameplay.GameplayObjects.Character;
|
|
using Unity.BossRoom.Utils;
|
|
using Unity.Netcode;
|
|
using UnityEngine;
|
|
|
|
namespace Unity.BossRoom.Gameplay.UI
|
|
{
|
|
/// <summary>
|
|
/// Class containing references to UI children that we can display. Both are disabled by default on prefab.
|
|
/// </summary>
|
|
public class UIStateDisplay : MonoBehaviour
|
|
{
|
|
public SwapConfirmationPanel swapConfirmationPanel;
|
|
public string playerName;
|
|
[SerializeField]
|
|
UIName m_UIName;
|
|
|
|
[SerializeField]
|
|
UIHealth m_UIHealth;
|
|
|
|
public void DisplayName(NetworkVariable<FixedPlayerName> networkedName)
|
|
{
|
|
m_UIName.gameObject.SetActive(true);
|
|
m_UIName.Initialize(networkedName);
|
|
playerName=networkedName.Value.ToString();
|
|
//var servercharacterName = GetComponentInParent<ServerCharacter>();
|
|
//servercharacterName.name = playerName;
|
|
swapConfirmationPanel.gameObject.name += networkedName.Value;
|
|
}
|
|
|
|
public void DisplayHealth(NetworkVariable<int> networkedHealth, int maxValue)
|
|
{
|
|
m_UIHealth.gameObject.SetActive(true);
|
|
m_UIHealth.Initialize(networkedHealth, maxValue);
|
|
}
|
|
|
|
public void HideHealth()
|
|
{
|
|
m_UIHealth.gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|