コード例 #1
0
        public void NotifyChanged_Should_change_component_on_created_entity()
        {
            Entity result = default;

            using EntityCommandRecorder recorder = new(1024);
            using World world         = new();
            using IDisposable changed = world.SubscribeComponentChanged((in Entity e, in bool _, in bool _) => result = e);

            EntityRecord record = recorder.CreateEntity(world);

            record.Set(true);
            record.NotifyChanged <bool>();

            recorder.Execute();

            Check.That(result).IsEqualTo(world.Single());
        }