示例#1
0
 static void ReadReferenceTable()
 {
     if (!File.Exists(GetResPath() + "/" + RefTable))
     {
         //Debug.LogError(string.Format("Can not Load RefTable", GetResPath() + "/" + RefTable));
         return;
     }
     ReferenceNode.Reset();
     try
     {
         //A文件异常(被锁定、其他),B序列化异常(内存不足?).
         FileStream           fs       = File.Open(GetResPath() + "/" + RefTable, FileMode.Open);
         List <ReferenceNode> refTable = ProtoBuf.Serializer.Deserialize <List <ReferenceNode> >(fs);
         for (int i = 0; i < refTable.Count; i++)
         {
             RegisterRes(refTable[i]);
         }
     }
     catch
     {
     }
 }