LethalCompany/Lethal Company/ExportedProject/Assets/Plugins/Assembly-CSharp-firstpass/ES3Internal/ES3ResourcesStream.cs
2023-12-22 18:30:10 -05:00

30 lines
518 B
C#

using System.IO;
using UnityEngine;
namespace ES3Internal
{
internal class ES3ResourcesStream : MemoryStream
{
public bool Exists => Length > 0;
public ES3ResourcesStream(string path)
: base(GetData(path))
{
}
private static byte[] GetData(string path)
{
TextAsset textAsset = Resources.Load(path) as TextAsset;
if (textAsset == null)
{
return new byte[0];
}
return textAsset.bytes;
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
}
}