public void RootTest_3() { IEntity e1 = new GameObject(); m_component.AddEntity(e1); IComponent c1 = new FakeComponent(); e1.AddComponent(c1); IEntity e2 = new GameObject(); c1.AddEntity(e2); IComponent c2 = new FakeComponent(); e2.AddComponent(c2); IEntity e3 = new GameObject(); c2.AddEntity(e3); Assert.AreSame(m_root, e1.Root); Assert.AreSame(m_root, c1.Parent.Root); Assert.AreSame(m_root, e2.Root); Assert.AreSame(m_root, c2.Parent.Root); Assert.AreSame(m_root, e3.Root); }
public void RootTest_5() { IEntity e1 = new GameObject(); m_component.AddEntity(e1); IComponent c1 = new FakeComponent(); e1.AddComponent(c1); IEntity e2 = new GameObject(); c1.AddEntity(e2); IComponent c2 = new FakeComponent(); e2.AddComponent(c2); IEntity e3 = new GameObject(); c2.AddEntity(e3); IComponent c3 = new FakeComponent(); e3.AddComponent(c3); IEntity e4 = new GameObject(); c3.AddEntity(e4); IComponent c4 = new FakeComponent(); e4.AddComponent(c4); IEntity e5 = new GameObject(); c4.AddEntity(e5); Assert.AreSame(m_root, e1.Root); Assert.AreSame(m_root, c1.Parent.Root); Assert.AreSame(m_root, e2.Root); Assert.AreSame(m_root, c2.Parent.Root); Assert.AreSame(m_root, e3.Root); Assert.AreSame(m_root, c3.Parent.Root); Assert.AreSame(m_root, e4.Root); Assert.AreSame(m_root, c4.Parent.Root); Assert.AreSame(m_root, e5.Root); }