Ejemplo n.º 1
0
        public void ToSceneNodeList()
        {
            GameObject parent = new GameObject();

            SceneNodeView.SetName(parent, "parent");
            GameObject child = new GameObject();

            SceneNodeView.SetName(child, "child");
            SceneNodeView.SetLocalX(child, 2.0f);
            SceneNodeView.AddChild(parent, child);
            List <GameObject>     children = SceneNodeView.GetChildren(parent);
            List <SceneNodeModel> nodes    = SceneNodeView.ToSceneNodeList(children);

            Assert.AreEqual(1, DataUtil.Length(nodes));
            Assert.AreEqual("child", nodes[0].name);
            Assert.AreEqual(2.0f, nodes[0].x);
            Assert.AreEqual(0.0f, nodes[0].y);
            Object.DestroyImmediate(parent);
            Object.DestroyImmediate(child);
        }