Munchy2007

Part6a_4

Mar 12th, 2018
9,103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment