This commit is contained in:
2025-07-11 14:40:42 +02:00
parent c39b87ed44
commit 0da6f275c0
42 changed files with 756 additions and 226 deletions

View File

@@ -29,7 +29,7 @@ namespace RebootKit.Engine.Simulation {
public const int k_DefaultMessageSize = 256;
public static NativeArray<byte> Serialize<TEntity>(TEntity entity,
Allocator allocator = Allocator.Temp)
Allocator allocator = Allocator.Temp)
where TEntity : ISerializableEntity {
int size = entity.MinimumSizeInBytes();
if (size < 0) {
@@ -130,10 +130,42 @@ namespace RebootKit.Engine.Simulation {
[NonSerialized] internal IActorData Data;
[SerializeField] string m_ActorName = "";
public string ActorName {
get {
return m_ActorName;
}
}
[Serializable]
public struct AttachmentSocket {
public string socketName;
public Transform root;
public Vector3 localPosition;
public Quaternion localRotation;
}
[SerializeField] AttachmentSocket[] m_AttachmentSockets;
public bool IsDataDirty { get; protected internal set; }
internal ActorsManager Manager;
public bool IsHidden() {
return !gameObject.activeSelf;
}
public void SetHidden(bool hidden) {
if (!RR.IsServer()) {
s_ActorLogger.Error($"Only the server can set actor visibility. Actor: {name} (ID: {ActorID})");
return;
}
Manager.SetActorHidden(ActorID, hidden);
}
internal IActorData InternalCreateActorData() {
return CreateActorData();
}