document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. using UnityEngine;
  2. using TMPro;
  3.  
  4. [RequireComponent(typeof(TextMeshProUGUI))]
  5. public class NameLabel : MonoBehaviour {
  6.  
  7.     void OnInstantiate(PhotonMessageInfo info)
  8.     {
  9.         var pView = GetComponentInParent<PhotonView>();
  10.         if (pView.isMine)
  11.         {
  12.             gameObject.SetActive(false);
  13.             return;
  14.         }
  15.  
  16.         GetComponent<TextMeshProUGUI>().text = pView.owner.NickName;
  17.     }
  18.  
  19. }
');