예제 #1
0
        private Object FindObject(int fileIndex, long pathID, bool isSafe)
        {
            if (fileIndex >= m_dependencies.Count)
            {
                if (isSafe)
                {
                    return(null);
                }
                throw new Exception($"AssetsFile with index {fileIndex} was not found in dependencies");
            }

            AssetsFilePtr filePtr = m_dependencies[fileIndex];
            IAssetsFile   file    = m_collection.FindAssetsFile(filePtr);

            if (file == null)
            {
                if (isSafe)
                {
                    return(null);
                }
                throw new Exception($"AssetsFile with index {fileIndex} was not found in collection");
            }

            Object @object = file.FindObject(pathID);

            if (@object == null)
            {
                if (isSafe)
                {
                    return(null);
                }
                throw new Exception($"Object with path ID {pathID} was not found");
            }
            return(@object);
        }
예제 #2
0
 public NativeFormatImporter(Object mainObject)
 {
     if (mainObject == null)
     {
         throw new ArgumentNullException(nameof(mainObject));
     }
     m_mainObject = mainObject;
 }
예제 #3
0
        public Object GetObject(long pathID)
        {
            Object @object = FindObject(pathID);

            if (@object == null)
            {
                throw new Exception($"Object with path ID {pathID} wasn't found");
            }

            return(@object);
        }
예제 #4
0
 public ExportPointer CreateExportPointer(Object @object)
 {
     return(m_collection.CreateExportPointer(@object));
 }
예제 #5
0
 public string GetExportID(Object @object)
 {
     return(m_collection.GetExportID(@object));
 }
예제 #6
0
        public override IExportCollection CreateCollection(Object @object)
        {
            AssetExportCollection collection = new AssetExportCollection(this, @object);

            return(collection);
        }