예제 #1
0
        public void Sending_component_update_changes_field()
        {
            WriterPublic.Send(new BlittableComponent.Update
            {
                IntField = new Option <int>(42)
            });
            int valueRead = EntityManager.GetComponentData <BlittableComponent.Component>(Entity).IntField;

            Assert.AreEqual(42, valueRead);
        }
예제 #2
0
        public void Readers_read_updated_value_after_sending_update()
        {
            WriterPublic.Send(new BlittableComponent.Update
            {
                IntField = new Option <int>(42)
            });
            int valueRead = ReaderPublic.Data.IntField;

            Assert.AreEqual(42, valueRead);
        }
예제 #3
0
        public void Updating_field_leaves_other_field_unchanged()
        {
            BlittableComponent.Component newValues = new BlittableComponent.Component();
            newValues.DoubleField = 13.37;
            EntityManager.SetComponentData(Entity, newValues);

            WriterPublic.Send(new BlittableComponent.Update
            {
                IntField = new Option <int>(42)
            });

            double valueRead = EntityManager.GetComponentData <BlittableComponent.Component>(Entity).DoubleField;

            Assert.AreEqual(13.37, valueRead);
        }