Exemplo n.º 1
0
        public void SetUp()
        {
            TestSystem = World.GetOrCreateSystem <MyTestSystem>();

            var myArch = m_Manager.CreateArchetype(
                ComponentType.ReadWrite <EcsTestData>(),
                ComponentType.ReadWrite <EcsTestData2>(),
                ComponentType.ReadWrite <EcsTestSharedComp>(),
                ComponentType.ReadWrite <TestBufferElement>(),
                ComponentType.ReadWrite <EcsTestTag>());

            TestEntity = m_Manager.CreateEntity(myArch);
            m_Manager.SetComponentData(TestEntity, new EcsTestData()
            {
                value = 3
            });
            m_Manager.SetComponentData(TestEntity, new EcsTestData2()
            {
                value0 = 4
            });
            var buffer = m_Manager.GetBuffer <TestBufferElement>(TestEntity);

            buffer.Add(new TestBufferElement()
            {
                Value = 18
            });
            buffer.Add(new TestBufferElement()
            {
                Value = 19
            });
            m_Manager.SetSharedComponentData(TestEntity, new EcsTestSharedComp()
            {
                value = 5
            });
        }
Exemplo n.º 2
0
            public void CanAssignThisValueInside()
            {
                EntityManager.CreateEntity();

                MyTestSystem thisSystem = null;

                Entities.WithStructuralChanges().ForEach((Entity e) =>
                {
                    thisSystem = this;
                }).Run();

                Assert.AreEqual(this, thisSystem);
            }
Exemplo n.º 3
0
 public void SetUp()
 {
     TestSystem = World.GetOrCreateSystem <MyTestSystem>();
 }