Example #1
0
        private void LoadChildren(XmlReader reader, ComponentIndexer componentIndexer)
        {
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "Children")
                {
                    return;
                }

                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (reader.Name == "GameObject")
                    {
                        GameObject g = new GameObject();
                        g.Load(reader, this, componentIndexer, transform.Scenegraph);
                    }
                }
            }
        }
Example #2
0
        internal void Load(XmlReader reader, GameObject parent, ComponentIndexer componentIndexer, Scenegraph scenegraph)
        {
            transform.Scenegraph = scenegraph;
            AddSubscriptions(null);
            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "GameObject")
                {
                    return;
                }

                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (reader.Name == "Children")
                    {
                        LoadChildren(reader, componentIndexer);
                    }
                    else
                    {
                        Component c = componentIndexer.GetComponentByName(reader.Name, this);
                        if (c == null)
                        {
                            throw new ParseException(reader.Name);
                        }

                        if (c is Transform)
                        {
                            transform.Load(reader);
                            if (parent != null)
                            {
                                transform.Parent = parent.transform;
                            }
                        }
                        else
                        {
                            c.Load(reader);
                            components.Add(c);
                        }
                    }
                }
            }
        }
Example #3
0
        private void LoadEntities(XmlReader reader)
        {
            ComponentIndexer componentIndexer = new ComponentIndexer();

            while (reader.Read())
            {
                if (reader.NodeType == XmlNodeType.EndElement && reader.Name.ToLower() == "entities")
                {
                    return;
                }

                if (reader.NodeType == XmlNodeType.Element)
                {
                    if (reader.Name == "GameObject")
                    {
                        GameObject g = new GameObject();
                        g.Load(reader, null, componentIndexer, scenegraph);
                        gameObjects.Add(g);
                    }
                }
            }
        }
Example #4
0
 public CompositeSwitcher(Component c, ComponentIndexer componentIndexer)
 {
     _componentIndexer = componentIndexer;
     _component        = c;//mail yaratiminda yada template yaratiminda eslestirilmesi gerekiyor
     _state            = _component.State;
 }
Example #5
0
 public void SetComponentIndexer(ComponentIndexer indexer)
 {
     _componentIndexer = indexer;
 }