Update README.md
Updated project Support 2017.4
This commit is contained in:
39
UnityStudio/Classes/TextAsset.cs
Normal file
39
UnityStudio/Classes/TextAsset.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
|
||||
namespace UnityStudio
|
||||
{
|
||||
class TextAsset
|
||||
{
|
||||
public string m_Name;
|
||||
public byte[] m_Script;
|
||||
|
||||
public TextAsset(AssetPreloadData preloadData, bool readSwitch)
|
||||
{
|
||||
var sourceFile = preloadData.sourceFile;
|
||||
var reader = preloadData.Reader;
|
||||
|
||||
if (sourceFile.platform == -2)
|
||||
{
|
||||
uint m_ObjectHideFlags = reader.ReadUInt32();
|
||||
PPtr m_PrefabParentObject = sourceFile.ReadPPtr();
|
||||
PPtr m_PrefabInternal = sourceFile.ReadPPtr();
|
||||
}
|
||||
|
||||
m_Name = reader.ReadAlignedString(reader.ReadInt32());
|
||||
|
||||
if (readSwitch)
|
||||
{
|
||||
m_Script = reader.ReadBytes(reader.ReadInt32());
|
||||
}
|
||||
else
|
||||
{
|
||||
preloadData.extension = ".txt";
|
||||
preloadData.Text = m_Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user