Skip to content

Commit

Permalink
Test_GitHub_58 - wip
Browse files Browse the repository at this point in the history
  • Loading branch information
friflo committed Feb 13, 2025
1 parent ee47063 commit ce89534
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Tests/ECS/Github/Test_GitHub_58.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ struct Health : IComponent
{
public float CurValue;
public Tags DeathTag;
public override string ToString() => $"{CurValue}";
}
class KillHeroSystem : QuerySystem<Health>
Expand All @@ -25,6 +27,7 @@ class KillHeroSystem : QuerySystem<Health>
protected override void OnUpdate()
{
var buffer = CommandBuffer;
Query.WithoutAnyTags(Tags.Get<Zombie, Monster>())
.ForEachEntity(
(ref Health health, Entity entity) =>
Expand All @@ -34,8 +37,12 @@ protected override void OnUpdate()
{
// entity.AddTags(health.DeathTag);
// entity.RemoveTags(Tags.Get<Hero>()); // << here is the problem
entity.RemoveTags(Tags.Get<Hero>());
entity.AddTags(health.DeathTag);
entity.AddTags(health.DeathTag);
// buffer.RemoveTags(entity.Id, Tags.Get<Hero>());
// buffer.AddTags(entity.Id, health.DeathTag);
_etags[entity.Id - 1] = health.DeathTag;
Console.WriteLine( $"Hero{entity.Id} -> {health.DeathTag.ToString()}");
}
Expand Down Expand Up @@ -68,7 +75,7 @@ private static void Exec()
const int n = 5;
var etags = new Tags[n];
var rnd = new Random();
var rnd = new Random(123);
for (var i = 0; i < n; i++)
{
Expand Down

0 comments on commit ce89534

Please sign in to comment.