mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-27 22:00:23 -04:00
Unity 2022.2+ AnimationClip fix
This commit is contained in:
parent
22ab5c0633
commit
ed7b0a2415
@ -15,7 +15,6 @@ namespace AssetStudio
|
|||||||
public T inWeight;
|
public T inWeight;
|
||||||
public T outWeight;
|
public T outWeight;
|
||||||
|
|
||||||
|
|
||||||
public Keyframe(ObjectReader reader, Func<T> readerFunc)
|
public Keyframe(ObjectReader reader, Func<T> readerFunc)
|
||||||
{
|
{
|
||||||
time = reader.ReadSingle();
|
time = reader.ReadSingle();
|
||||||
@ -294,15 +293,20 @@ namespace AssetStudio
|
|||||||
public string path;
|
public string path;
|
||||||
public ClassIDType classID;
|
public ClassIDType classID;
|
||||||
public PPtr<MonoScript> script;
|
public PPtr<MonoScript> script;
|
||||||
|
public int flags;
|
||||||
|
|
||||||
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[0] > 2022 || (version[0] == 2022 && version[1] >= 2)) //2022.2 and up
|
||||||
|
{
|
||||||
|
flags = reader.ReadInt32();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -311,7 +315,6 @@ namespace AssetStudio
|
|||||||
public float time;
|
public float time;
|
||||||
public PPtr<Object> value;
|
public PPtr<Object> value;
|
||||||
|
|
||||||
|
|
||||||
public PPtrKeyframe(ObjectReader reader)
|
public PPtrKeyframe(ObjectReader reader)
|
||||||
{
|
{
|
||||||
time = reader.ReadSingle();
|
time = reader.ReadSingle();
|
||||||
@ -326,10 +329,11 @@ namespace AssetStudio
|
|||||||
public string path;
|
public string path;
|
||||||
public int classID;
|
public int classID;
|
||||||
public PPtr<MonoScript> script;
|
public PPtr<MonoScript> script;
|
||||||
|
public int flags;
|
||||||
|
|
||||||
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++)
|
||||||
@ -341,6 +345,10 @@ 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[0] > 2022 || (version[0] == 2022 && version[1] >= 2)) //2022.2 and up
|
||||||
|
{
|
||||||
|
flags = reader.ReadInt32();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -940,7 +948,6 @@ namespace AssetStudio
|
|||||||
public AnimationClipBindingConstant m_ClipBindingConstant;
|
public AnimationClipBindingConstant m_ClipBindingConstant;
|
||||||
public AnimationEvent[] m_Events;
|
public AnimationEvent[] m_Events;
|
||||||
|
|
||||||
|
|
||||||
public AnimationClip(ObjectReader reader) : base(reader)
|
public AnimationClip(ObjectReader reader) : base(reader)
|
||||||
{
|
{
|
||||||
if (version[0] >= 5)//5.0 and up
|
if (version[0] >= 5)//5.0 and up
|
||||||
|
Loading…
Reference in New Issue
Block a user