Ejemplo n.º 1
0
        public void UnloadIDMappingFrom(MappingInfo mapping)
        {
            MappingInfo.IDLists idLists;
            if (mapping.LibToIDs.TryGetValue(this, out idLists))
            {
                for (int i = 0; i < idLists.InstanceIDs.Count; ++i)
                {
                    int instanceID = idLists.InstanceIDs[i];
                    mapping.InstanceIDtoPID.Remove(instanceID);
                }

                for (int i = 0; i < idLists.PersistentIDs.Count; ++i)
                {
                    int persistentID = idLists.PersistentIDs[i];
                    mapping.PersistentIDtoObj.Remove(persistentID);
                }

                mapping.LibToIDs.Remove(this);
            }
        }
Ejemplo n.º 2
0
        public void LoadIDMappingTo(MappingInfo mapping, bool IIDtoPID, bool PIDtoObj)
        {
            if (!IIDtoPID && !PIDtoObj)
            {
                return;
            }

            if (m_assetLibrary == null || m_assetLibrary.Folders == null || m_assetLibrary.Folders.Count == 0)
            {
                return;
            }

            List <int> instanceIDs   = new List <int>();
            List <int> persistentIDs = new List <int>();

            for (int i = 0; i < m_assetLibrary.Folders.Count; ++i)
            {
                AssetFolderInfo folder = m_assetLibrary.Folders[i];
                if (folder != null)
                {
                    if (folder.Assets != null && folder.Assets.Count > 0)
                    {
                        for (int j = 0; j < folder.Assets.Count; ++j)
                        {
                            AssetInfo asset = folder.Assets[j];
                            if (asset.Object != null)
                            {
                                LoadIDMappingTo(asset, mapping, instanceIDs, persistentIDs, IIDtoPID, PIDtoObj);
                            }
                        }
                    }
                }
            }

            mapping.Add(this, instanceIDs, persistentIDs);
        }
Ejemplo n.º 3
0
 private void UnloadMappings()
 {
     m_mapping = new MappingInfo();
 }