Ejemplo n.º 1
0
 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;
         }
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
 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;
     }
 }