Ejemplo n.º 1
0
 public void Setup()
 {
     for (int index = 0; index < DataUtil.Length(menus); index++)
     {
         if (DataUtil.Length(buttons) <= index)
         {
             GameObject menu = menus[index];
             buttons.Add(SceneNodeView.GetChildren(menu, true));
         }
     }
     if (null == animatorOwner)
     {
         animatorOwner = gameObject;
     }
 }
Ejemplo n.º 2
0
        public void GetChildren()
        {
            GameObject parent = new GameObject();

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

            SceneNodeView.SetName(child, "child");
            SceneNodeView.AddChild(parent, child);
            List <GameObject> children = SceneNodeView.GetChildren(parent);

            Assert.AreEqual(1, DataUtil.Length(children));
            Assert.AreEqual("child", SceneNodeView.GetName(children[0]));
            Assert.AreEqual(child, children[0]);
            Object.DestroyImmediate(parent);
            Object.DestroyImmediate(child);
        }
Ejemplo n.º 3
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);
        }