public void ComponentAccessAfterScheduledJobThrowsEntityArray()
        {
            m_Manager.CreateEntity(typeof(EcsTestData), typeof(EcsTestData2));

            var job = new TestCopy1To2Job();

            job.entities = EmptySystem.GetEntities <TestEntity>();

            var fence = job.Schedule();

            var entityArray = EmptySystem.GetEntities <TestEntity>();

            Assert.Throws <System.InvalidOperationException>(() => { var temp = entityArray[0]; });

            fence.Complete();
        }
        public void ComponentGroupArrayJobScheduleDetectsWriteDependency()
        {
            var entity = m_Manager.CreateEntity(typeof(EcsTestData), typeof(EcsTestData2));

            m_Manager.SetComponentData(entity, new EcsTestData(42));

            var job = new TestCopy1To2Job();

            job.entities = EmptySystem.GetEntities <TestEntity>();

            var fence = job.Schedule();

            Assert.Throws <System.InvalidOperationException>(() => { job.Schedule(); });

            fence.Complete();
        }
Esempio n. 3
0
        public void ComponentAccessAfterScheduledJobThrowsEntityArray()
        {
            var entityArrayCache = new ComponentGroupArrayStaticCache(typeof(TestEntity), m_Manager);

            m_Manager.CreateComponentGroup(typeof(EcsTestData));
            m_Manager.CreateEntity(typeof(EcsTestData), typeof(EcsTestData2));

            var job = new TestCopy1To2Job();

            job.entities = new ComponentGroupArray <TestEntity>(entityArrayCache);

            var fence = job.Schedule();

            var entityArray = new ComponentGroupArray <TestEntity>(entityArrayCache);

            Assert.Throws <System.InvalidOperationException>(() => { var temp = entityArray[0]; });

            fence.Complete();
        }