Exemple #1
0
        public void NotUsingDataIsHarmless()
        {
            var entity = m_Manager.CreateEntity(typeof(EcsTestData));

            m_Manager.SetComponentData(entity, new EcsTestData(42));
            ReadSystem1 rs1 = World.GetOrCreateSystem <ReadSystem1>();
            ReadSystem3 rs3 = World.GetOrCreateSystem <ReadSystem3>();

            rs1.Update();
            rs3.Update();
        }
Exemple #2
0
        public void ReturningWrongJobThrowsInCorrectSystemUpdate()
        {
            var entity = m_Manager.CreateEntity(typeof(EcsTestData));

            m_Manager.SetComponentData(entity, new EcsTestData(42));
            ReadSystem1 rs1 = World.GetOrCreateSystem <ReadSystem1>();
            ReadSystem2 rs2 = World.GetOrCreateSystem <ReadSystem2>();

            rs2.returnWrongJob = true;

            rs1.Update();
            Assert.Throws <System.InvalidOperationException>(() => { rs2.Update(); });
        }