public PPtr(Stream stream, AssetCabinet file) { LoadFrom(stream); if (m_FileID == 0) { int index; Component comp = file.FindComponent(m_PathID, out index); if (comp is NotLoaded) { long pos = stream.Position; asset = file.LoadComponent(stream, index, (NotLoaded)comp); if (asset == null) { asset = comp; } stream.Position = pos; } else { asset = comp; } if (asset is T) { instance = (T)asset; } } }
public AssetInfo(AssetCabinet file, Stream stream) { this.file = file; BinaryReader reader = new BinaryReader(stream); preloadIndex = reader.ReadInt32(); preloadSize = reader.ReadInt32(); PPtr <Object> objPtr = new PPtr <Object>(stream); if (objPtr.m_FileID == 0 && objPtr.m_PathID != 0) { Component comp = file.FindComponent(objPtr.m_PathID, false); if (comp == null) { comp = new NotLoaded(file, objPtr.m_PathID, 0, 0); } asset = new PPtr <Object>(comp); } else { asset = objPtr; } }
public AssetInfo(AssetCabinet file, Stream stream) { this.file = file; BinaryReader reader = new BinaryReader(stream); preloadIndex = reader.ReadInt32(); preloadSize = reader.ReadInt32(); PPtr<Object> objPtr = new PPtr<Object>(stream); if (objPtr.m_FileID == 0 && objPtr.m_PathID != 0) { Component comp = file.FindComponent(objPtr.m_PathID, false); if (comp == null) { comp = new NotLoaded(file, objPtr.m_PathID, 0, 0); } asset = new PPtr<Object>(comp); } else { asset = objPtr; } }