21 lines
456 B
C#
21 lines
456 B
C#
using TMPro;
|
|
using UnityEngine;
|
|
|
|
public class PlayerCountCanvas : MonoBehaviour
|
|
{
|
|
Transform cam;
|
|
[SerializeField] private TMP_Text playerCountText;
|
|
|
|
void Start()
|
|
{
|
|
cam = GameObject.FindGameObjectWithTag("MainCamera").transform;
|
|
}
|
|
void LateUpdate()
|
|
{
|
|
transform.LookAt(cam.forward + transform.position);
|
|
}
|
|
public void SetPlayerCount(int count)
|
|
{
|
|
playerCountText.text = count.ToString();
|
|
}
|
|
} |