1
This commit is contained in:
26
Src/Unity/Scripts/Entity/Core/UnityIdComponent.cs
Normal file
26
Src/Unity/Scripts/Entity/Core/UnityIdComponent.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITKit.Entities
|
||||
{
|
||||
public interface IdComponent
|
||||
{
|
||||
ulong Id { get; }
|
||||
string Name { get; }
|
||||
}
|
||||
public class UnityIdComponent : EntityBehavior,IdComponent
|
||||
{
|
||||
[SerializeField] private ulong id;
|
||||
[SerializeField] private string unityName;
|
||||
public ulong Id => id;
|
||||
public string Name => unityName;
|
||||
public override void Initialize(IEntity _entity)
|
||||
{
|
||||
base.Initialize(_entity);
|
||||
id = _entity.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user