Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class NetPlayer : Photon.MonoBehaviour
- {
- public static readonly List<NetPlayer> Players = new List<NetPlayer>();
- public string Name { get; private set; }
- void Awake()
- {
- Players.Add(this);
- }
- void OnDestroy()
- {
- Player.Remove(this);
- }
- }
- //in some scripts...
- class Fool
- {
- void DoSomething()
- {
- var players = NetPlayer.Players;
- if(players[0].Name == "Admin"){
- var go = players[0].gameObject;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment