예제 #1
0
        public void TestChildSceneNodeDestruction()
        {
            SceneManager sceneManager = new PCZSceneManager("Manager under test");
            SceneNode    node         = sceneManager.CreateSceneNode("testNode");
            SceneNode    childNode    = node.CreateChildSceneNode("childNode");

            Assert.IsTrue(ManagerContainsNode(sceneManager, childNode), "A child node was created but not added to the scene graph.");

            node.RemoveAndDestroyChild(childNode);

            Assert.IsFalse(ManagerContainsNode(sceneManager, childNode), "A child node was destroryed but not removed from the scene graph.");
        }
        public void TestChildSceneNodeRemoval()
        {
            SceneManager sceneManager = new PCZSceneManager("Manager under test");
            SceneNode    node         = sceneManager.CreateSceneNode("testNode");
            SceneNode    childNode    = node.CreateChildSceneNode("childNode");

            Assert.IsTrue(ManagerContainsNode(sceneManager, childNode), "A child node was created but not added to the scene graph.");

            node.RemoveChild(childNode.Name);

            Assert.IsTrue(ManagerContainsNode(sceneManager, childNode), "A child node was removed from its parent but also incorrectly removed from the scene graph.");
        }