Example #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);
            }
        }
Example #2
0
        public ProjectAsyncOperation Open(string project, ProjectEventHandler callback)
        {
            m_staticReferencesMapping = new MappingInfo();

            /*
             * for (int i = 0; i < StaticReferences.Length; ++i)
             * {
             *  AssetLibraryAsset reference = StaticReferences[i];
             *  if (reference != null)
             *  {
             *      reference.LoadIDMappingTo(m_staticReferencesMapping, false, true);
             *  }
             * }
             */
            ProjectAsyncOperation ao = new ProjectAsyncOperation();

            m_projectPath = project;

            m_assetDB.UnloadLibraries();

            m_storage.GetProject(m_projectPath, (error, projectInfo) =>
            {
                if (error.HasError)
                {
                    if (callback != null)
                    {
                        callback(error);
                    }

                    ao.Error       = error;
                    ao.IsCompleted = true;
                    return;
                }

                OnOpened(project, projectInfo, ao, callback);
            });
            return(ao);
        }
Example #3
0
 private void UnloadMappings()
 {
     m_mapping = new MappingInfo();
 }