Beispiel #1
0
        public bool loadNamedPrefab(string name, LoadingContext ctx)
        {
            GeoStoreDef geo_store = groupGetFileEntryPtr(name);

            if (null == geo_store)
            {
                return(false);
            }
            if (geo_store.loaded)
            {
                return(true);
            }

            geo_store.loaded = true;
            // load given prefab's geoset
            GeoSet.Load(geo_store.geopath, m_base_path);
            ctx.loadSubgraph(geo_store.geopath, this);
            return(loadPrefabForNode(ctx.m_target.getNodeByName(name), ctx));
        }
Beispiel #2
0
        internal bool loadPrefabForNode(SceneNode node, LoadingContext ctx) //groupLoadRequiredLibsForNode
        {
            GeoStoreDef gf;

            if (null == node || false == node.in_use)
            {
                return(false);
            }

            if (null != node.m_geoset_info)
            {
                gf = node.m_geoset_info;
            }
            else
            {
                gf = groupGetFileEntryPtr(node.m_name);
                node.m_geoset_info = gf;
                if (null == node.m_geoset_info)
                {
                    node.m_geoset_info = m_geostore_sentinel; // prevent future load attempts
                }
            }

            if (null == gf || gf == m_geostore_sentinel)
            {
                return(false);
            }

            if (!gf.loaded)
            {
                gf.loaded = true;
                GeoSet.Load(gf.geopath, m_base_path); // load given subgraph's root geoset
                ctx.loadSubgraph(gf.geopath, this);
            }

            return(true);
        }