mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
Fix support for sprite assets from Unity <5.2
This commit is contained in:
parent
bb7accd04d
commit
6c515aee2e
@ -58,7 +58,7 @@ namespace AssetStudio
|
||||
public bool TryGet(out T result, SerializedFile assetsFile = null)
|
||||
{
|
||||
_assetsFile = _assetsFile ?? assetsFile;
|
||||
if (TryGetAssetsFile(out var sourceFile))
|
||||
if (!IsNull && TryGetAssetsFile(out var sourceFile))
|
||||
{
|
||||
if (sourceFile.ObjectsDic.TryGetValue(m_PathID, out var obj))
|
||||
{
|
||||
@ -77,7 +77,7 @@ namespace AssetStudio
|
||||
public bool TryGet<T2>(out T2 result, SerializedFile assetsFile = null) where T2 : Object
|
||||
{
|
||||
_assetsFile = _assetsFile ?? assetsFile;
|
||||
if (TryGetAssetsFile(out var sourceFile))
|
||||
if (!IsNull && TryGetAssetsFile(out var sourceFile))
|
||||
{
|
||||
if (sourceFile.ObjectsDic.TryGetValue(m_PathID, out var obj))
|
||||
{
|
||||
|
@ -99,10 +99,7 @@ namespace AssetStudio
|
||||
var version = reader.version;
|
||||
|
||||
texture = new PPtr<Texture2D>(reader);
|
||||
if (version >= (5, 2)) //5.2 and up
|
||||
{
|
||||
alphaTexture = new PPtr<Texture2D>(reader);
|
||||
}
|
||||
alphaTexture = version >= (5, 2) ? new PPtr<Texture2D>(reader) : new PPtr<Texture2D>(); //5.2 and up
|
||||
|
||||
if (version >= 2019) //2019 and up
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user