Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using TMPro;
- [RequireComponent(typeof(TextMeshProUGUI))]
- public class NameLabel : MonoBehaviour {
- void OnInstantiate(PhotonMessageInfo info)
- {
- var pView = GetComponentInParent<PhotonView>();
- if (pView.isMine)
- {
- gameObject.SetActive(false);
- return;
- }
- GetComponent<TextMeshProUGUI>().text = pView.owner.NickName;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment