Skip to content

Commit 18bad80

Browse files
committed
Fixed VisualDebugger bug when components are added on entity creation #87
1 parent b2ea776 commit 18bad80

File tree

6 files changed

+50
-1
lines changed

6 files changed

+50
-1
lines changed

Entitas.Unity/Assets/Entitas/Unity/VisualDebugging/PoolObserver/Editor/PoolObserverInspector.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public override void OnInspectorGUI() {
3232
if (GUILayout.Button("Create Entity")) {
3333
var entity = poolObserver.pool.CreateEntity();
3434
var entityBehaviour = Object.FindObjectsOfType<EntityBehaviour>()
35-
.Single(eb => eb.name == entity.ToString());
35+
.Single(eb => eb.entity == entity);
3636

3737
Selection.activeGameObject = entityBehaviour.gameObject;
3838
}

Entitas.Unity/Assets/Tests/Manual Tests/Multiple Pools.meta

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

Entitas.Unity/Assets/Tests/Manual Tests/Multiple Pools/Multiple Pools Scene.unity.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using UnityEngine;
2+
using Entitas;
3+
4+
public class MultiplePoolsController : MonoBehaviour {
5+
6+
Pool _poolA;
7+
Pool _poolB;
8+
9+
void Start () {
10+
11+
_poolA = new Pool(ComponentIds.TotalComponents, 0, new PoolMetaData("Pool A", ComponentIds.componentNames, ComponentIds.componentTypes));
12+
new Entitas.Unity.VisualDebugging.PoolObserver(_poolA);
13+
14+
_poolB = new Pool(ComponentIds.TotalComponents, 0, new PoolMetaData("Pool B", ComponentIds.componentNames, ComponentIds.componentTypes));
15+
new Entitas.Unity.VisualDebugging.PoolObserver(_poolB);
16+
17+
18+
_poolA.OnEntityCreated += (pool, entity) => entity.AddMyInt(42);
19+
}
20+
}

Entitas.Unity/Assets/Tests/Manual Tests/Multiple Pools/MultiplePoolsController.cs.meta

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)