powerfun-unity/Assets/Scripts/Scenes/AR/UI/WatchPanelScript.cs

25 lines
605 B
C#
Raw Normal View History

2022-03-31 18:40:19 +08:00
using UnityEngine;
using UnityEngine.UI;
namespace Assets.Scripts.Scenes.VideoRide
{
2023-05-15 15:11:50 +08:00
public class WatchPanelScript:MonoBehaviour
2022-03-31 18:40:19 +08:00
{
2023-05-15 15:11:50 +08:00
private VideoGameManager manager { get; set; }
private Text userName { get; set; }
2022-03-31 18:40:19 +08:00
private void Start()
{
manager = FindObjectOfType<VideoGameManager>();
userName = transform.Find("name").GetComponent<Text>();
}
private void Update()
{
if (manager != null)
{
userName.text = manager.CurrentPlayer?.UserName;
}
}
}
}