From 8cb0194699c0bfe3940086c32b1ee4b6169cfdf8 Mon Sep 17 00:00:00 2001 From: friflo Date: Tue, 14 Jan 2025 08:12:25 +0100 Subject: [PATCH] update signal example --- src/Tests/ECS/Examples/General.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Tests/ECS/Examples/General.cs b/src/Tests/ECS/Examples/General.cs index b16adc45..754886b7 100644 --- a/src/Tests/ECS/Examples/General.cs +++ b/src/Tests/ECS/Examples/General.cs @@ -257,14 +257,17 @@ public static void AddSignalHandler() var store = new EntityStore(); var player = store.CreateEntity(1); player.AddSignalHandler(signal => { - Console.WriteLine($"player collision with entity: {signal.Event.other.Id}"); - // > player collision with entity: 2 + Console.WriteLine($"collision signal - entity: {signal.Entity.Id} other: {signal.Event.other.Id}"); }); var npc = store.CreateEntity(2); // ... detect collision. e.g. with a collision system. In case of collision: player.EmitSignal(new CollisionSignal{ other = npc }); } +/* Output +collision signal - entity: 1 other: 2 +*/ + } } \ No newline at end of file