Skip to content

Commit

Permalink
[v0.1.10] Some API maked public; Dependency updated
Browse files Browse the repository at this point in the history
  • Loading branch information
g0dzZz-coder committed May 28, 2024
1 parent cc08908 commit e57a84c
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Runtime/Components/AuthoringComponentDatabase.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// © 2023-2024 Nikolay Melnikov <n.melnikov@depra.org>

using System.Collections.Generic;
using Depra.Ecs.Hybrid.Entities;
using Depra.Ecs.Worlds;
using UnityEngine;
Expand All @@ -13,6 +14,8 @@ public sealed class AuthoringComponentDatabase : MonoBehaviour, IAuthoring
{
[SerializeField] private ComponentDatabase[] _components;

public IEnumerable<ComponentDatabase> Enumerate() => _components;

IBaker IAuthoring.CreateBaker() => new Baker(_components);

private readonly struct Baker : IBaker
Expand Down
4 changes: 2 additions & 2 deletions Runtime/Entities/AuthoringEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ private void OnEnable()
public IEnumerable<IAuthoring> Nested => GetComponents<IAuthoring>()
.Where(x => ReferenceEquals(x, this) == false);

public bool Unpack(out World world, out Entity entity) => _entity.Unpack(out world, out entity);

private void Initialize(PackedEntityWithWorld entity)
{
_entity = entity;
Expand All @@ -64,8 +66,6 @@ private void FinalizeConversion()

IBaker IAuthoring.CreateBaker() => new Backer();

bool IAuthoringEntity.Unpack(out Entity entity) => _entity.Unpack(out _, out entity);

private readonly struct Backer : IBaker
{
void IBaker.Bake(IAuthoring authoring, World world)
Expand Down
12 changes: 12 additions & 0 deletions Runtime/Entities/AuthoringEntityExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// SPDX-License-Identifier: Apache-2.0
// © 2023-2024 Nikolay Melnikov <n.melnikov@depra.org>

using Depra.Ecs.Entities;

namespace Depra.Ecs.Hybrid.Entities
{
public static class AuthoringEntityExtensions
{
public static bool Unpack(this IAuthoringEntity self, out Entity entity) => self.Unpack(out _, out entity);
}
}
3 changes: 3 additions & 0 deletions Runtime/Entities/AuthoringEntityExtensions.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Runtime/Entities/IAuthoringEntity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

using Depra.Ecs.Entities;
using Depra.Ecs.Hybrid.Components;
using Depra.Ecs.Worlds;

namespace Depra.Ecs.Hybrid.Entities
{
public interface IAuthoringEntity : IAuthoring
{
bool Unpack(out Entity entity);
bool Unpack(out World world, out Entity entity);
}
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"name": "com.depra.ecs.hybrid",
"version": "0.1.9",
"version": "0.1.10",
"displayName": "Depra.Ecs.Hybrid",
"description": "Unity Conversion Workflow for Depra.Ecs. Easy convert GameObjects to Entity.",
"unity": "2022.3",
"license": "Apache-2.0",
"dependencies": {
"com.depra.ecs.unity": "0.2.6",
"com.depra.serialize-reference.extensions": "0.0.10"
"com.depra.serialize-reference.extensions": "0.0.14"
},
"keywords": [
"depra",
"ecs",
"bake",
"baking",
Expand Down

0 comments on commit e57a84c

Please sign in to comment.