FastArena/Assets/Network/GameObjectId.cs

17 lines
406 B
C#

using System;
using UnityEngine;
namespace FastArena.Network
{
public class GameObjectId : MonoBehaviour
{
public int Id { get; private set; } = -1;
internal void _SetId(int packetGameObjectId)
{
if (Id != -1)
throw new Exception($"GameObjectId is already set to {Id}");
Id = packetGameObjectId;
}
}
}