Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static Provider ParseFile(string p_fileName, bool p_useCache = true)
- {
- if (p_useCache && AnimationBinaryParser.CreatecacheBinary() && AnimationBinaryParser._CachedBinary.ContainsKey(p_fileName))
- {
- return AnimationBinaryParser._CachedBinary[p_fileName];
- }
- byte[] binary = ResourceManager.GetBinary(p_fileName);
- MemoryStream memoryStream = new MemoryStream(binary);
- BinaryReader binaryReader = new BinaryReader(memoryStream);
- int num = binaryReader.ReadInt32();
- Provider provider = new Provider(num);
- for (int i = 0; i < num; i++)
- {
- binaryReader.ReadByte();
- int num2 = binaryReader.ReadInt32();
- Vector3[] array = new Vector3[46];
- for (int j = 0; j < num2; j++)
- {
- if (j >= 46)
- {
- binaryReader.ReadSingle();
- binaryReader.ReadSingle();
- binaryReader.ReadSingle();
- }
- else
- {
- array[j].x = binaryReader.ReadSingle();
- array[j].y = -binaryReader.ReadSingle();
- array[j].z = binaryReader.ReadSingle();
- }
- }
- provider.Add(array, i);
- }
- binaryReader.Close();
- memoryStream.Close();
- if (p_useCache)
- {
- AnimationBinaryParser._CachedBinary.Add(p_fileName, provider);
- }
- return provider;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement