public virtual IObjectInfo GetObjectInfo(PPtr pptr) { if (pptr.FileID == 0 && pptr.PathID == 0) { return(new NullObjectInfo(pptr.TypeID)); } if (pptr.FileID == 0) { ObjectInfo info = null; if (objects.TryGetValue(pptr.PathID, out info)) { return(info); } return(new MissingObjectInfo(this, pptr.PathID, pptr.TypeID)); } ArchiveRef assetRef = this.archiveRefs[pptr.FileID]; ObjectArchive asset = this.Bundle.GetAssetArchive(assetRef.FileName) as ObjectArchive; if (asset != null) { return(asset.GetObjectInfo(pptr.PathID)); } var container = this.Bundle.ArchiveContainer; if (container == null) { return(new MissingObjectInfo(null, pptr.PathID, pptr.TypeID)); } return(container.GetObjectInfo(assetRef.FileName, pptr.PathID)); }
public List <IObjectInfo> GetReferences() { if (references != null) { return(references); } lock (_lock) { if (references != null) { return(this.references); } this.references = new List <IObjectInfo>(); ObjectArchive archive = (ObjectArchive)this.info.Archive; foreach (PPtr pptr in pptrs) { this.references.Add(archive.GetObjectInfo(pptr)); } return(references); } }
public virtual IObjectInfo GetObjectInfo(string assetName, long pathId) { lock (_lock) { foreach (var builtinAsset in builtinArchives) { if (!builtinAsset.Name.Equals(assetName)) { continue; } return(builtinAsset.GetObjectInfo(pathId)); } ObjectArchive asset = GetAssetArchive(assetName) as ObjectArchive; if (asset != null) { return(asset.GetObjectInfo(pathId)); } UnityEngine.Debug.LogWarningFormat("Object not found,AssetName:{0} ID:{1}", assetName, pathId); return(new MissingObjectInfo(null, pathId, TypeID.UnknownType)); } }