mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-26 13:50:21 -04:00
Improve support of Unity 2023+
This commit is contained in:
parent
348aea2be8
commit
fa332b45df
@ -563,6 +563,9 @@ namespace AssetStudio
|
|||||||
case ClassIDType.Avatar:
|
case ClassIDType.Avatar:
|
||||||
obj = new Avatar(objectReader);
|
obj = new Avatar(objectReader);
|
||||||
break;
|
break;
|
||||||
|
case ClassIDType.BuildSettings:
|
||||||
|
obj = new BuildSettings(objectReader);
|
||||||
|
break;
|
||||||
case ClassIDType.Font:
|
case ClassIDType.Font:
|
||||||
obj = new Font(objectReader);
|
obj = new Font(objectReader);
|
||||||
break;
|
break;
|
||||||
|
@ -45,7 +45,6 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public AnimationCurve(ObjectReader reader, Func<T> readerFunc)
|
public AnimationCurve(ObjectReader reader, Func<T> readerFunc)
|
||||||
{
|
{
|
||||||
var version = reader.version;
|
|
||||||
int numCurves = reader.ReadInt32();
|
int numCurves = reader.ReadInt32();
|
||||||
m_Curve = new Keyframe<T>[numCurves];
|
m_Curve = new Keyframe<T>[numCurves];
|
||||||
for (int i = 0; i < numCurves; i++)
|
for (int i = 0; i < numCurves; i++)
|
||||||
@ -55,7 +54,7 @@ namespace AssetStudio
|
|||||||
|
|
||||||
m_PreInfinity = reader.ReadInt32();
|
m_PreInfinity = reader.ReadInt32();
|
||||||
m_PostInfinity = reader.ReadInt32();
|
m_PostInfinity = reader.ReadInt32();
|
||||||
if (version >= (5, 3)) //5.3 and up
|
if (reader.version >= (5, 3)) //5.3 and up
|
||||||
{
|
{
|
||||||
m_RotationOrder = reader.ReadInt32();
|
m_RotationOrder = reader.ReadInt32();
|
||||||
}
|
}
|
||||||
@ -317,13 +316,12 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public FloatCurve(ObjectReader reader)
|
public FloatCurve(ObjectReader reader)
|
||||||
{
|
{
|
||||||
var version = reader.version;
|
|
||||||
curve = new AnimationCurve<float>(reader, reader.ReadSingle);
|
curve = new AnimationCurve<float>(reader, reader.ReadSingle);
|
||||||
attribute = reader.ReadAlignedString();
|
attribute = reader.ReadAlignedString();
|
||||||
path = reader.ReadAlignedString();
|
path = reader.ReadAlignedString();
|
||||||
classID = (ClassIDType)reader.ReadInt32();
|
classID = (ClassIDType)reader.ReadInt32();
|
||||||
script = new PPtr<MonoScript>(reader);
|
script = new PPtr<MonoScript>(reader);
|
||||||
if (version >= (2022, 2)) //2022.2 and up
|
if (reader.version >= (2022, 2)) //2022.2 and up
|
||||||
{
|
{
|
||||||
flags = reader.ReadInt32();
|
flags = reader.ReadInt32();
|
||||||
}
|
}
|
||||||
@ -357,7 +355,6 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public PPtrCurve(ObjectReader reader)
|
public PPtrCurve(ObjectReader reader)
|
||||||
{
|
{
|
||||||
var version = reader.version;
|
|
||||||
int numCurves = reader.ReadInt32();
|
int numCurves = reader.ReadInt32();
|
||||||
curve = new PPtrKeyframe[numCurves];
|
curve = new PPtrKeyframe[numCurves];
|
||||||
for (int i = 0; i < numCurves; i++)
|
for (int i = 0; i < numCurves; i++)
|
||||||
@ -369,7 +366,7 @@ namespace AssetStudio
|
|||||||
path = reader.ReadAlignedString();
|
path = reader.ReadAlignedString();
|
||||||
classID = reader.ReadInt32();
|
classID = reader.ReadInt32();
|
||||||
script = new PPtr<MonoScript>(reader);
|
script = new PPtr<MonoScript>(reader);
|
||||||
if (version >= (2022, 2)) //2022.2 and up
|
if (reader.version >= (2022, 2)) //2022.2 and up
|
||||||
{
|
{
|
||||||
flags = reader.ReadInt32();
|
flags = reader.ReadInt32();
|
||||||
}
|
}
|
||||||
@ -506,8 +503,18 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public StreamedClip(ObjectReader reader)
|
public StreamedClip(ObjectReader reader)
|
||||||
{
|
{
|
||||||
|
var version = reader.version;
|
||||||
data = reader.ReadUInt32Array();
|
data = reader.ReadUInt32Array();
|
||||||
curveCount = reader.ReadUInt32();
|
if (version.IsInRange((2022, 3, 19), 2023) //2022.3.19f1 to 2023
|
||||||
|
|| version >= (2023, 2, 8)) //2023.2.8f1 and up
|
||||||
|
{
|
||||||
|
curveCount = reader.ReadUInt16();
|
||||||
|
var discreteCurveCount = reader.ReadUInt16();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
curveCount = reader.ReadUInt32();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class StreamedCurveKey
|
public class StreamedCurveKey
|
||||||
@ -644,9 +651,8 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public ValueConstant(ObjectReader reader)
|
public ValueConstant(ObjectReader reader)
|
||||||
{
|
{
|
||||||
var version = reader.version;
|
|
||||||
m_ID = reader.ReadUInt32();
|
m_ID = reader.ReadUInt32();
|
||||||
if (version < (5, 5)) //5.5 down
|
if (reader.version < (5, 5)) //5.5 down
|
||||||
{
|
{
|
||||||
m_TypeID = reader.ReadUInt32();
|
m_TypeID = reader.ReadUInt32();
|
||||||
}
|
}
|
||||||
@ -872,6 +878,7 @@ namespace AssetStudio
|
|||||||
public byte customType;
|
public byte customType;
|
||||||
public byte isPPtrCurve;
|
public byte isPPtrCurve;
|
||||||
public byte isIntCurve;
|
public byte isIntCurve;
|
||||||
|
public byte isSerializeReferenceCurve;
|
||||||
|
|
||||||
public GenericBinding() { }
|
public GenericBinding() { }
|
||||||
|
|
||||||
@ -895,6 +902,10 @@ namespace AssetStudio
|
|||||||
{
|
{
|
||||||
isIntCurve = reader.ReadByte();
|
isIntCurve = reader.ReadByte();
|
||||||
}
|
}
|
||||||
|
if (version >= (2022, 2)) //2022.2 and up
|
||||||
|
{
|
||||||
|
isSerializeReferenceCurve = reader.ReadByte();
|
||||||
|
}
|
||||||
reader.AlignStream();
|
reader.AlignStream();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -973,14 +984,12 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public AnimationEvent(ObjectReader reader)
|
public AnimationEvent(ObjectReader reader)
|
||||||
{
|
{
|
||||||
var version = reader.version;
|
|
||||||
|
|
||||||
time = reader.ReadSingle();
|
time = reader.ReadSingle();
|
||||||
functionName = reader.ReadAlignedString();
|
functionName = reader.ReadAlignedString();
|
||||||
data = reader.ReadAlignedString();
|
data = reader.ReadAlignedString();
|
||||||
objectReferenceParameter = new PPtr<Object>(reader);
|
objectReferenceParameter = new PPtr<Object>(reader);
|
||||||
floatParameter = reader.ReadSingle();
|
floatParameter = reader.ReadSingle();
|
||||||
if (version >= 3) //3 and up
|
if (reader.version >= 3) //3 and up
|
||||||
{
|
{
|
||||||
intParameter = reader.ReadInt32();
|
intParameter = reader.ReadInt32();
|
||||||
}
|
}
|
||||||
@ -1052,8 +1061,7 @@ namespace AssetStudio
|
|||||||
else if (version >= 4)//4.0 and up
|
else if (version >= 4)//4.0 and up
|
||||||
{
|
{
|
||||||
m_AnimationType = (AnimationType)reader.ReadInt32();
|
m_AnimationType = (AnimationType)reader.ReadInt32();
|
||||||
if (m_AnimationType == AnimationType.Legacy)
|
m_Legacy = m_AnimationType == AnimationType.Legacy;
|
||||||
m_Legacy = true;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
namespace AssetStudio
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace AssetStudio
|
|
||||||
{
|
{
|
||||||
public sealed class Animator : Behaviour
|
public sealed class Animator : Behaviour
|
||||||
{
|
{
|
||||||
@ -35,6 +30,10 @@ namespace AssetStudio
|
|||||||
{
|
{
|
||||||
var m_StabilizeFeet = reader.ReadBoolean();
|
var m_StabilizeFeet = reader.ReadBoolean();
|
||||||
}
|
}
|
||||||
|
if (version >= (2023, 1)) //2023.1 and up
|
||||||
|
{
|
||||||
|
var m_AnimatePhysics = reader.ReadBoolean();
|
||||||
|
}
|
||||||
reader.AlignStream();
|
reader.AlignStream();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,24 +1,20 @@
|
|||||||
using System;
|
namespace AssetStudio
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace AssetStudio
|
|
||||||
{
|
{
|
||||||
public sealed class BuildSettings : Object
|
public sealed class BuildSettings : Object
|
||||||
{
|
{
|
||||||
public string m_Version;
|
public string[] levels;
|
||||||
|
public string[] scenes;
|
||||||
|
|
||||||
public BuildSettings(ObjectReader reader) : base(reader)
|
public BuildSettings(ObjectReader reader) : base(reader)
|
||||||
{
|
{
|
||||||
var levels = reader.ReadStringArray();
|
if (reader.version < (5, 1)) //5.1 down
|
||||||
|
{
|
||||||
var hasRenderTexture = reader.ReadBoolean();
|
levels = reader.ReadStringArray();
|
||||||
var hasPROVersion = reader.ReadBoolean();
|
}
|
||||||
var hasPublishingRights = reader.ReadBoolean();
|
else
|
||||||
var hasShadows = reader.ReadBoolean();
|
{
|
||||||
|
scenes = reader.ReadStringArray();
|
||||||
m_Version = reader.ReadAlignedString();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
using System;
|
namespace AssetStudio
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace AssetStudio
|
|
||||||
{
|
{
|
||||||
public class StaticBatchInfo
|
public class StaticBatchInfo
|
||||||
{
|
{
|
||||||
@ -58,6 +53,15 @@ namespace AssetStudio
|
|||||||
{
|
{
|
||||||
var m_RayTraceProcedural = reader.ReadByte();
|
var m_RayTraceProcedural = reader.ReadByte();
|
||||||
}
|
}
|
||||||
|
if (version >= (2023, 2)) //2023.2 and up
|
||||||
|
{
|
||||||
|
var m_RayTracingAccelStructBuildFlagsOverride = reader.ReadByte();
|
||||||
|
var m_RayTracingAccelStructBuildFlags = reader.ReadByte();
|
||||||
|
}
|
||||||
|
if (version >= (2023, 3)) //2023.3 and up
|
||||||
|
{
|
||||||
|
var m_SmallMeshCulling = reader.ReadByte();
|
||||||
|
}
|
||||||
reader.AlignStream();
|
reader.AlignStream();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -128,7 +132,7 @@ namespace AssetStudio
|
|||||||
var m_UseLightProbes = reader.ReadBoolean();
|
var m_UseLightProbes = reader.ReadBoolean();
|
||||||
reader.AlignStream();
|
reader.AlignStream();
|
||||||
|
|
||||||
if (version >= 5)//5.0 and up
|
if (version >= 5) //5.0 and up
|
||||||
{
|
{
|
||||||
var m_ReflectionProbeUsage = reader.ReadInt32();
|
var m_ReflectionProbeUsage = reader.ReadInt32();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user