SanAndreasUnity/Assets/Scripts/Networking/Player.cs
2020-05-31 19:09:37 +02:00

35 lines
742 B
C#

using System.Collections.Generic;
using UnityEngine;
using Mirror;
namespace SanAndreasUnity.Net
{
public class Player : NetworkBehaviour
{
static List<Player> s_allPlayers = new List<Player>();
public static Player[] AllPlayers { get { return s_allPlayers.ToArray(); } }
[SyncVar] GameObject m_ownedGameObject;
public GameObject OwnedGameObject { get { return m_ownedGameObject; } internal set { m_ownedGameObject = value; } }
void OnEnable()
{
s_allPlayers.Add(this);
}
void OnDisable()
{
s_allPlayers.Remove(this);
}
void Start()
{
}
}
}