- [Core] Fix bug with assets parsing.
This commit is contained in:
@@ -7,16 +7,16 @@ namespace AssetStudio
|
||||
{
|
||||
public sealed class Animation : Behaviour
|
||||
{
|
||||
public PPtr<AnimationClip>[] m_Animations;
|
||||
public List<PPtr<AnimationClip>> m_Animations;
|
||||
|
||||
public Animation(ObjectReader reader) : base(reader)
|
||||
{
|
||||
var m_Animation = new PPtr<AnimationClip>(reader);
|
||||
int numAnimations = reader.ReadInt32();
|
||||
m_Animations = new PPtr<AnimationClip>[numAnimations];
|
||||
m_Animations = new List<PPtr<AnimationClip>>();
|
||||
for (int i = 0; i < numAnimations; i++)
|
||||
{
|
||||
m_Animations[i] = new PPtr<AnimationClip>(reader);
|
||||
m_Animations.Add(new PPtr<AnimationClip>(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace AssetStudio
|
||||
{
|
||||
var version = reader.version;
|
||||
int numCurves = reader.ReadInt32();
|
||||
m_Curve = new List<Keyframe<T>>(numCurves);
|
||||
m_Curve = new List<Keyframe<T>>();
|
||||
for (int i = 0; i < numCurves; i++)
|
||||
{
|
||||
m_Curve.Add(new Keyframe<T>(reader, readerFunc));
|
||||
@@ -568,7 +568,7 @@ namespace AssetStudio
|
||||
public PPtrCurve(ObjectReader reader)
|
||||
{
|
||||
int numCurves = reader.ReadInt32();
|
||||
curve = new List<PPtrKeyframe>(numCurves);
|
||||
curve = new List<PPtrKeyframe>();
|
||||
for (int i = 0; i < numCurves; i++)
|
||||
{
|
||||
curve.Add(new PPtrKeyframe(reader));
|
||||
@@ -646,7 +646,7 @@ namespace AssetStudio
|
||||
|
||||
public HandPose(ObjectReader reader)
|
||||
{
|
||||
m_GrabX = reader.ReadXForm(reader.version);
|
||||
m_GrabX = reader.ReadXForm();
|
||||
m_DoFArray = reader.ReadSingleArray();
|
||||
m_Override = reader.ReadSingle();
|
||||
m_CloseOpen = reader.ReadSingle();
|
||||
@@ -658,7 +658,7 @@ namespace AssetStudio
|
||||
{
|
||||
var handPose = new HandPose();
|
||||
|
||||
handPose.m_GrabX = reader.ReadXForm(reader.version, true);
|
||||
handPose.m_GrabX = reader.ReadXForm4();
|
||||
handPose.m_DoFArray = reader.ReadSingleArray(20);
|
||||
handPose.m_Override = reader.ReadSingle();
|
||||
handPose.m_CloseOpen = reader.ReadSingle();
|
||||
@@ -681,7 +681,7 @@ namespace AssetStudio
|
||||
public HumanGoal(ObjectReader reader)
|
||||
{
|
||||
var version = reader.version;
|
||||
m_X = reader.ReadXForm(reader.version);
|
||||
m_X = reader.ReadXForm();
|
||||
m_WeightT = reader.ReadSingle();
|
||||
m_WeightR = reader.ReadSingle();
|
||||
if (version[0] >= 5)//5.0 and up
|
||||
@@ -695,7 +695,7 @@ namespace AssetStudio
|
||||
{
|
||||
var humanGoal = new HumanGoal();
|
||||
|
||||
humanGoal.m_X = reader.ReadXForm(reader.version, true);
|
||||
humanGoal.m_X = reader.ReadXForm4();
|
||||
humanGoal.m_WeightT = reader.ReadSingle();
|
||||
humanGoal.m_WeightR = reader.ReadSingle();
|
||||
|
||||
@@ -714,7 +714,7 @@ namespace AssetStudio
|
||||
public XForm m_RootX;
|
||||
public Vector3 m_LookAtPosition;
|
||||
public Vector4 m_LookAtWeight;
|
||||
public HumanGoal[] m_GoalArray;
|
||||
public List<HumanGoal> m_GoalArray;
|
||||
public HandPose m_LeftHandPose;
|
||||
public HandPose m_RightHandPose;
|
||||
public float[] m_DoFArray;
|
||||
@@ -724,15 +724,15 @@ namespace AssetStudio
|
||||
public HumanPose(ObjectReader reader)
|
||||
{
|
||||
var version = reader.version;
|
||||
m_RootX = reader.ReadXForm(reader.version);
|
||||
m_RootX = reader.ReadXForm();
|
||||
m_LookAtPosition = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? reader.ReadVector3() : (Vector3)reader.ReadVector4();//5.4 and up
|
||||
m_LookAtWeight = reader.ReadVector4();
|
||||
|
||||
int numGoals = reader.ReadInt32();
|
||||
m_GoalArray = new HumanGoal[numGoals];
|
||||
m_GoalArray = new List<HumanGoal>();
|
||||
for (int i = 0; i < numGoals; i++)
|
||||
{
|
||||
m_GoalArray[i] = new HumanGoal(reader);
|
||||
m_GoalArray.Add(new HumanGoal(reader));
|
||||
}
|
||||
|
||||
m_LeftHandPose = new HandPose(reader);
|
||||
@@ -742,28 +742,23 @@ namespace AssetStudio
|
||||
|
||||
if (version[0] > 5 || (version[0] == 5 && version[1] >= 2))//5.2 and up
|
||||
{
|
||||
int numTDof = reader.ReadInt32();
|
||||
m_TDoFArray = new Vector3[numTDof];
|
||||
for (int i = 0; i < numTDof; i++)
|
||||
{
|
||||
m_TDoFArray[i] = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? reader.ReadVector3() : (Vector3)reader.ReadVector4();//5.4 and up
|
||||
m_TDoFArray = reader.ReadVector3Array();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static HumanPose ParseGI(ObjectReader reader)
|
||||
{
|
||||
var version = reader.version;
|
||||
var humanPose = new HumanPose();
|
||||
|
||||
humanPose.m_RootX = reader.ReadXForm(version, true);
|
||||
humanPose.m_RootX = reader.ReadXForm4();
|
||||
humanPose.m_LookAtPosition = (Vector3)reader.ReadVector4();
|
||||
humanPose.m_LookAtWeight = reader.ReadVector4();
|
||||
|
||||
humanPose.m_GoalArray = new HumanGoal[4];
|
||||
humanPose.m_GoalArray = new List<HumanGoal>();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
humanPose.m_GoalArray[i] = HumanGoal.ParseGI(reader);
|
||||
humanPose.m_GoalArray.Add(HumanGoal.ParseGI(reader));
|
||||
}
|
||||
|
||||
humanPose.m_LeftHandPose = HandPose.ParseGI(reader);
|
||||
@@ -771,11 +766,7 @@ namespace AssetStudio
|
||||
|
||||
humanPose.m_DoFArray = reader.ReadSingleArray(0x37);
|
||||
|
||||
humanPose.m_TDoFArray = new Vector3[0x15];
|
||||
for (int i = 0; i < 0x15; i++)
|
||||
{
|
||||
humanPose.m_TDoFArray[i] = (Vector3)reader.ReadVector4();
|
||||
}
|
||||
humanPose.m_TDoFArray = reader.ReadVector4Array(0x15).Select(x => (Vector3)x).ToArray();
|
||||
|
||||
reader.Position += 4;
|
||||
|
||||
@@ -973,17 +964,17 @@ namespace AssetStudio
|
||||
public class StreamedFrame
|
||||
{
|
||||
public float time;
|
||||
public StreamedCurveKey[] keyList;
|
||||
public List<StreamedCurveKey> keyList;
|
||||
|
||||
public StreamedFrame(EndianBinaryReader reader)
|
||||
{
|
||||
time = reader.ReadSingle();
|
||||
|
||||
int numKeys = reader.ReadInt32();
|
||||
keyList = new StreamedCurveKey[numKeys];
|
||||
keyList = new List<StreamedCurveKey>();
|
||||
for (int i = 0; i < numKeys; i++)
|
||||
{
|
||||
keyList[i] = new StreamedCurveKey(reader);
|
||||
keyList.Add(new StreamedCurveKey(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1220,15 +1211,15 @@ namespace AssetStudio
|
||||
|
||||
public class ValueArrayConstant
|
||||
{
|
||||
public ValueConstant[] m_ValueArray;
|
||||
public List<ValueConstant> m_ValueArray;
|
||||
|
||||
public ValueArrayConstant(ObjectReader reader)
|
||||
{
|
||||
int numVals = reader.ReadInt32();
|
||||
m_ValueArray = new ValueConstant[numVals];
|
||||
m_ValueArray = new List<ValueConstant>();
|
||||
for (int i = 0; i < numVals; i++)
|
||||
{
|
||||
m_ValueArray[i] = new ValueConstant(reader);
|
||||
m_ValueArray.Add(new ValueConstant(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1301,7 +1292,7 @@ namespace AssetStudio
|
||||
var bindings = new AnimationClipBindingConstant();
|
||||
var genericBindings = new List<GenericBinding>();
|
||||
var values = m_Binding;
|
||||
for (int i = 0; i < values.m_ValueArray.Length;)
|
||||
for (int i = 0; i < values.m_ValueArray.Count;)
|
||||
{
|
||||
var curveID = values.m_ValueArray[i].m_ID;
|
||||
var curveTypeID = values.m_ValueArray[i].m_TypeID;
|
||||
@@ -1336,7 +1327,7 @@ namespace AssetStudio
|
||||
i++;
|
||||
}
|
||||
}
|
||||
bindings.genericBindings = genericBindings.ToArray();
|
||||
bindings.genericBindings = genericBindings;
|
||||
return bindings;
|
||||
}
|
||||
}
|
||||
@@ -1371,7 +1362,7 @@ namespace AssetStudio
|
||||
public float m_CycleOffset;
|
||||
public float m_AverageAngularSpeed;
|
||||
public int[] m_IndexArray;
|
||||
public ValueDelta[] m_ValueArrayDelta;
|
||||
public List<ValueDelta> m_ValueArrayDelta;
|
||||
public float[] m_ValueArrayReferencePose;
|
||||
public bool m_Mirror;
|
||||
public bool m_LoopTime;
|
||||
@@ -1391,17 +1382,17 @@ namespace AssetStudio
|
||||
{
|
||||
var version = reader.version;
|
||||
m_DeltaPose = new HumanPose(reader);
|
||||
m_StartX = reader.ReadXForm(reader.version);
|
||||
m_StartX = reader.ReadXForm();
|
||||
if (version[0] > 5 || (version[0] == 5 && version[1] >= 5))//5.5 and up
|
||||
{
|
||||
m_StopX = reader.ReadXForm(reader.version);
|
||||
m_StopX = reader.ReadXForm();
|
||||
}
|
||||
m_LeftFootStartX = reader.ReadXForm(reader.version);
|
||||
m_RightFootStartX = reader.ReadXForm(reader.version);
|
||||
m_LeftFootStartX = reader.ReadXForm();
|
||||
m_RightFootStartX = reader.ReadXForm();
|
||||
if (version[0] < 5)//5.0 down
|
||||
{
|
||||
m_MotionStartX = reader.ReadXForm(reader.version);
|
||||
m_MotionStopX = reader.ReadXForm(reader.version);
|
||||
m_MotionStartX = reader.ReadXForm();
|
||||
m_MotionStopX = reader.ReadXForm();
|
||||
}
|
||||
m_AverageSpeed = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? reader.ReadVector3() : (Vector3)reader.ReadVector4();//5.4 and up
|
||||
m_Clip = new Clip(reader);
|
||||
@@ -1425,10 +1416,10 @@ namespace AssetStudio
|
||||
var m_AdditionalCurveIndexArray = reader.ReadInt32Array();
|
||||
}
|
||||
int numDeltas = reader.ReadInt32();
|
||||
m_ValueArrayDelta = new ValueDelta[numDeltas];
|
||||
m_ValueArrayDelta = new List<ValueDelta>();
|
||||
for (int i = 0; i < numDeltas; i++)
|
||||
{
|
||||
m_ValueArrayDelta[i] = new ValueDelta(reader);
|
||||
m_ValueArrayDelta.Add(new ValueDelta(reader));
|
||||
}
|
||||
if (version[0] > 5 || (version[0] == 5 && version[1] >= 3))//5.3 and up
|
||||
{
|
||||
@@ -1460,10 +1451,10 @@ namespace AssetStudio
|
||||
var clipMuscleConstant = new ClipMuscleConstant();
|
||||
|
||||
clipMuscleConstant.m_DeltaPose = HumanPose.ParseGI(reader);
|
||||
clipMuscleConstant.m_StartX = reader.ReadXForm(version, true);
|
||||
clipMuscleConstant.m_StopX = reader.ReadXForm(version, true);
|
||||
clipMuscleConstant.m_LeftFootStartX = reader.ReadXForm(version, true);
|
||||
clipMuscleConstant.m_RightFootStartX = reader.ReadXForm(version, true);
|
||||
clipMuscleConstant.m_StartX = reader.ReadXForm4();
|
||||
clipMuscleConstant.m_StopX = reader.ReadXForm4();
|
||||
clipMuscleConstant.m_LeftFootStartX = reader.ReadXForm4();
|
||||
clipMuscleConstant.m_RightFootStartX = reader.ReadXForm4();
|
||||
|
||||
clipMuscleConstant.m_AverageSpeed = (Vector3)reader.ReadVector4();
|
||||
|
||||
@@ -1510,10 +1501,10 @@ namespace AssetStudio
|
||||
if (valueArrayDeltaCount > 0)
|
||||
{
|
||||
reader.Position = valueArrayDeltaOffset;
|
||||
clipMuscleConstant.m_ValueArrayDelta = new ValueDelta[valueArrayDeltaCount];
|
||||
clipMuscleConstant.m_ValueArrayDelta = new List<ValueDelta>();
|
||||
for (int i = 0; i < valueArrayDeltaCount; i++)
|
||||
{
|
||||
clipMuscleConstant.m_ValueArrayDelta[i] = new ValueDelta(reader);
|
||||
clipMuscleConstant.m_ValueArrayDelta.Add(new ValueDelta(reader));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1611,25 +1602,25 @@ namespace AssetStudio
|
||||
|
||||
public class AnimationClipBindingConstant : IYAMLExportable
|
||||
{
|
||||
public GenericBinding[] genericBindings;
|
||||
public PPtr<Object>[] pptrCurveMapping;
|
||||
public List<GenericBinding> genericBindings;
|
||||
public List<PPtr<Object>> pptrCurveMapping;
|
||||
|
||||
public AnimationClipBindingConstant() { }
|
||||
|
||||
public AnimationClipBindingConstant(ObjectReader reader)
|
||||
{
|
||||
int numBindings = reader.ReadInt32();
|
||||
genericBindings = new GenericBinding[numBindings];
|
||||
genericBindings = new List<GenericBinding>();
|
||||
for (int i = 0; i < numBindings; i++)
|
||||
{
|
||||
genericBindings[i] = new GenericBinding(reader);
|
||||
genericBindings.Add(new GenericBinding(reader));
|
||||
}
|
||||
|
||||
int numMappings = reader.ReadInt32();
|
||||
pptrCurveMapping = new PPtr<Object>[numMappings];
|
||||
pptrCurveMapping = new List<PPtr<Object>>();
|
||||
for (int i = 0; i < numMappings; i++)
|
||||
{
|
||||
pptrCurveMapping[i] = new PPtr<Object>(reader);
|
||||
pptrCurveMapping.Add(new PPtr<Object>(reader));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1732,20 +1723,20 @@ namespace AssetStudio
|
||||
public bool m_Legacy;
|
||||
public bool m_Compressed;
|
||||
public bool m_UseHighQualityCurve;
|
||||
public QuaternionCurve[] m_RotationCurves;
|
||||
public CompressedAnimationCurve[] m_CompressedRotationCurves;
|
||||
public Vector3Curve[] m_EulerCurves;
|
||||
public Vector3Curve[] m_PositionCurves;
|
||||
public Vector3Curve[] m_ScaleCurves;
|
||||
public FloatCurve[] m_FloatCurves;
|
||||
public PPtrCurve[] m_PPtrCurves;
|
||||
public List<QuaternionCurve> m_RotationCurves;
|
||||
public List<CompressedAnimationCurve> m_CompressedRotationCurves;
|
||||
public List<Vector3Curve> m_EulerCurves;
|
||||
public List<Vector3Curve> m_PositionCurves;
|
||||
public List<Vector3Curve> m_ScaleCurves;
|
||||
public List<FloatCurve> m_FloatCurves;
|
||||
public List<PPtrCurve> m_PPtrCurves;
|
||||
public float m_SampleRate;
|
||||
public int m_WrapMode;
|
||||
public AABB m_Bounds;
|
||||
public uint m_MuscleClipSize;
|
||||
public ClipMuscleConstant m_MuscleClip;
|
||||
public AnimationClipBindingConstant m_ClipBindingConstant;
|
||||
public AnimationEvent[] m_Events;
|
||||
public List<AnimationEvent> m_Events;
|
||||
public StreamingInfo m_StreamData;
|
||||
|
||||
private bool hasStreamingInfo = false;
|
||||
@@ -1773,57 +1764,57 @@ namespace AssetStudio
|
||||
}
|
||||
reader.AlignStream();
|
||||
int numRCurves = reader.ReadInt32();
|
||||
m_RotationCurves = new QuaternionCurve[numRCurves];
|
||||
m_RotationCurves = new List<QuaternionCurve>();
|
||||
for (int i = 0; i < numRCurves; i++)
|
||||
{
|
||||
m_RotationCurves[i] = new QuaternionCurve(reader);
|
||||
m_RotationCurves.Add(new QuaternionCurve(reader));
|
||||
}
|
||||
|
||||
int numCRCurves = reader.ReadInt32();
|
||||
m_CompressedRotationCurves = new CompressedAnimationCurve[numCRCurves];
|
||||
m_CompressedRotationCurves = new List<CompressedAnimationCurve>();
|
||||
for (int i = 0; i < numCRCurves; i++)
|
||||
{
|
||||
m_CompressedRotationCurves[i] = new CompressedAnimationCurve(reader);
|
||||
m_CompressedRotationCurves.Add(new CompressedAnimationCurve(reader));
|
||||
}
|
||||
|
||||
if (version[0] > 5 || (version[0] == 5 && version[1] >= 3))//5.3 and up
|
||||
{
|
||||
int numEulerCurves = reader.ReadInt32();
|
||||
m_EulerCurves = new Vector3Curve[numEulerCurves];
|
||||
m_EulerCurves = new List<Vector3Curve>();
|
||||
for (int i = 0; i < numEulerCurves; i++)
|
||||
{
|
||||
m_EulerCurves[i] = new Vector3Curve(reader);
|
||||
m_EulerCurves.Add(new Vector3Curve(reader));
|
||||
}
|
||||
}
|
||||
|
||||
int numPCurves = reader.ReadInt32();
|
||||
m_PositionCurves = new Vector3Curve[numPCurves];
|
||||
m_PositionCurves = new List<Vector3Curve>();
|
||||
for (int i = 0; i < numPCurves; i++)
|
||||
{
|
||||
m_PositionCurves[i] = new Vector3Curve(reader);
|
||||
m_PositionCurves.Add(new Vector3Curve(reader));
|
||||
}
|
||||
|
||||
int numSCurves = reader.ReadInt32();
|
||||
m_ScaleCurves = new Vector3Curve[numSCurves];
|
||||
m_ScaleCurves = new List<Vector3Curve>();
|
||||
for (int i = 0; i < numSCurves; i++)
|
||||
{
|
||||
m_ScaleCurves[i] = new Vector3Curve(reader);
|
||||
m_ScaleCurves.Add(new Vector3Curve(reader));
|
||||
}
|
||||
|
||||
int numFCurves = reader.ReadInt32();
|
||||
m_FloatCurves = new FloatCurve[numFCurves];
|
||||
m_FloatCurves = new List<FloatCurve>();
|
||||
for (int i = 0; i < numFCurves; i++)
|
||||
{
|
||||
m_FloatCurves[i] = new FloatCurve(reader);
|
||||
m_FloatCurves.Add(new FloatCurve(reader));
|
||||
}
|
||||
|
||||
if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up
|
||||
{
|
||||
int numPtrCurves = reader.ReadInt32();
|
||||
m_PPtrCurves = new PPtrCurve[numPtrCurves];
|
||||
m_PPtrCurves = new List<PPtrCurve>();
|
||||
for (int i = 0; i < numPtrCurves; i++)
|
||||
{
|
||||
m_PPtrCurves[i] = new PPtrCurve(reader);
|
||||
m_PPtrCurves.Add(new PPtrCurve(reader));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1864,10 +1855,10 @@ namespace AssetStudio
|
||||
{
|
||||
var m_AclClipData = reader.ReadUInt8Array();
|
||||
var aclBindingsCount = reader.ReadInt32();
|
||||
var m_AclBindings = new GenericBinding[aclBindingsCount];
|
||||
var m_AclBindings = new List<GenericBinding>();
|
||||
for (int i = 0; i < aclBindingsCount; i++)
|
||||
{
|
||||
m_AclBindings[i] = new GenericBinding(reader);
|
||||
m_AclBindings.Add(new GenericBinding(reader));
|
||||
}
|
||||
var m_AclRange = new KeyValuePair<float, float>(reader.ReadSingle(), reader.ReadSingle());
|
||||
}
|
||||
@@ -1882,10 +1873,10 @@ namespace AssetStudio
|
||||
reader.AlignStream();
|
||||
}
|
||||
int numEvents = reader.ReadInt32();
|
||||
m_Events = new AnimationEvent[numEvents];
|
||||
m_Events = new List<AnimationEvent>();
|
||||
for (int i = 0; i < numEvents; i++)
|
||||
{
|
||||
m_Events[i] = new AnimationEvent(reader);
|
||||
m_Events.Add(new AnimationEvent(reader));
|
||||
}
|
||||
if (version[0] >= 2017) //2017 and up
|
||||
{
|
||||
|
||||
@@ -38,15 +38,15 @@ namespace AssetStudio
|
||||
|
||||
public class SkeletonMask
|
||||
{
|
||||
public SkeletonMaskElement[] m_Data;
|
||||
public List<SkeletonMaskElement> m_Data;
|
||||
|
||||
public SkeletonMask(ObjectReader reader)
|
||||
{
|
||||
int numElements = reader.ReadInt32();
|
||||
m_Data = new SkeletonMaskElement[numElements];
|
||||
m_Data = new List<SkeletonMaskElement>();
|
||||
for (int i = 0; i < numElements; i++)
|
||||
{
|
||||
m_Data[i] = new SkeletonMaskElement(reader);
|
||||
m_Data.Add(new SkeletonMaskElement(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace AssetStudio
|
||||
|
||||
public class TransitionConstant
|
||||
{
|
||||
public ConditionConstant[] m_ConditionConstantArray;
|
||||
public List<ConditionConstant> m_ConditionConstantArray;
|
||||
public uint m_DestinationState;
|
||||
public uint m_FullPathID;
|
||||
public uint m_ID;
|
||||
@@ -124,10 +124,10 @@ namespace AssetStudio
|
||||
var version = reader.version;
|
||||
|
||||
int numConditions = reader.ReadInt32();
|
||||
m_ConditionConstantArray = new ConditionConstant[numConditions];
|
||||
m_ConditionConstantArray = new List<ConditionConstant>();
|
||||
for (int i = 0; i < numConditions; i++)
|
||||
{
|
||||
m_ConditionConstantArray[i] = new ConditionConstant(reader);
|
||||
m_ConditionConstantArray.Add(new ConditionConstant(reader));
|
||||
}
|
||||
|
||||
m_DestinationState = reader.ReadUInt32();
|
||||
@@ -191,7 +191,7 @@ namespace AssetStudio
|
||||
public float[] m_ChildMagnitudeArray;
|
||||
public Vector2[] m_ChildPairVectorArray;
|
||||
public float[] m_ChildPairAvgMagInvArray;
|
||||
public MotionNeighborList[] m_ChildNeighborListArray;
|
||||
public List<MotionNeighborList> m_ChildNeighborListArray;
|
||||
|
||||
public Blend2dDataConstant(ObjectReader reader)
|
||||
{
|
||||
@@ -201,10 +201,10 @@ namespace AssetStudio
|
||||
m_ChildPairAvgMagInvArray = reader.ReadSingleArray();
|
||||
|
||||
int numNeighbours = reader.ReadInt32();
|
||||
m_ChildNeighborListArray = new MotionNeighborList[numNeighbours];
|
||||
m_ChildNeighborListArray = new List<MotionNeighborList>();
|
||||
for (int i = 0; i < numNeighbours; i++)
|
||||
{
|
||||
m_ChildNeighborListArray[i] = new MotionNeighborList(reader);
|
||||
m_ChildNeighborListArray.Add(new MotionNeighborList(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -303,7 +303,7 @@ namespace AssetStudio
|
||||
|
||||
public class BlendTreeConstant
|
||||
{
|
||||
public BlendTreeNodeConstant[] m_NodeArray;
|
||||
public List<BlendTreeNodeConstant> m_NodeArray;
|
||||
public ValueArrayConstant m_BlendEventArrayConstant;
|
||||
|
||||
public BlendTreeConstant(ObjectReader reader)
|
||||
@@ -311,10 +311,10 @@ namespace AssetStudio
|
||||
var version = reader.version;
|
||||
|
||||
int numNodes = reader.ReadInt32();
|
||||
m_NodeArray = new BlendTreeNodeConstant[numNodes];
|
||||
m_NodeArray = new List<BlendTreeNodeConstant>();
|
||||
for (int i = 0; i < numNodes; i++)
|
||||
{
|
||||
m_NodeArray[i] = new BlendTreeNodeConstant(reader);
|
||||
m_NodeArray.Add(new BlendTreeNodeConstant(reader));
|
||||
}
|
||||
|
||||
if (version[0] < 4 || (version[0] == 4 && version[1] < 5)) //4.5 down
|
||||
@@ -327,10 +327,10 @@ namespace AssetStudio
|
||||
|
||||
public class StateConstant
|
||||
{
|
||||
public TransitionConstant[] m_TransitionConstantArray;
|
||||
public List<TransitionConstant> m_TransitionConstantArray;
|
||||
public int[] m_BlendTreeConstantIndexArray;
|
||||
public LeafInfoConstant[] m_LeafInfoArray;
|
||||
public BlendTreeConstant[] m_BlendTreeConstantArray;
|
||||
public List<LeafInfoConstant> m_LeafInfoArray;
|
||||
public List<BlendTreeConstant> m_BlendTreeConstantArray;
|
||||
public uint m_NameID;
|
||||
public uint m_PathID;
|
||||
public uint m_FullPathID;
|
||||
@@ -350,10 +350,10 @@ namespace AssetStudio
|
||||
var version = reader.version;
|
||||
|
||||
int numTransistions = reader.ReadInt32();
|
||||
m_TransitionConstantArray = new TransitionConstant[numTransistions];
|
||||
m_TransitionConstantArray = new List<TransitionConstant>();
|
||||
for (int i = 0; i < numTransistions; i++)
|
||||
{
|
||||
m_TransitionConstantArray[i] = new TransitionConstant(reader);
|
||||
m_TransitionConstantArray.Add(new TransitionConstant(reader));
|
||||
}
|
||||
|
||||
m_BlendTreeConstantIndexArray = reader.ReadInt32Array();
|
||||
@@ -361,18 +361,18 @@ namespace AssetStudio
|
||||
if (version[0] < 5 || (version[0] == 5 && version[1] < 2)) //5.2 down
|
||||
{
|
||||
int numInfos = reader.ReadInt32();
|
||||
m_LeafInfoArray = new LeafInfoConstant[numInfos];
|
||||
m_LeafInfoArray = new List<LeafInfoConstant>();
|
||||
for (int i = 0; i < numInfos; i++)
|
||||
{
|
||||
m_LeafInfoArray[i] = new LeafInfoConstant(reader);
|
||||
m_LeafInfoArray.Add(new LeafInfoConstant(reader));
|
||||
}
|
||||
}
|
||||
|
||||
int numBlends = reader.ReadInt32();
|
||||
m_BlendTreeConstantArray = new BlendTreeConstant[numBlends];
|
||||
m_BlendTreeConstantArray = new List<BlendTreeConstant>();
|
||||
for (int i = 0; i < numBlends; i++)
|
||||
{
|
||||
m_BlendTreeConstantArray[i] = new BlendTreeConstant(reader);
|
||||
m_BlendTreeConstantArray.Add(new BlendTreeConstant(reader));
|
||||
}
|
||||
|
||||
m_NameID = reader.ReadUInt32();
|
||||
@@ -428,34 +428,34 @@ namespace AssetStudio
|
||||
public class SelectorTransitionConstant
|
||||
{
|
||||
public uint m_Destination;
|
||||
public ConditionConstant[] m_ConditionConstantArray;
|
||||
public List<ConditionConstant> m_ConditionConstantArray;
|
||||
|
||||
public SelectorTransitionConstant(ObjectReader reader)
|
||||
{
|
||||
m_Destination = reader.ReadUInt32();
|
||||
|
||||
int numConditions = reader.ReadInt32();
|
||||
m_ConditionConstantArray = new ConditionConstant[numConditions];
|
||||
m_ConditionConstantArray = new List<ConditionConstant>();
|
||||
for (int i = 0; i < numConditions; i++)
|
||||
{
|
||||
m_ConditionConstantArray[i] = new ConditionConstant(reader);
|
||||
m_ConditionConstantArray.Add(new ConditionConstant(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SelectorStateConstant
|
||||
{
|
||||
public SelectorTransitionConstant[] m_TransitionConstantArray;
|
||||
public List<SelectorTransitionConstant> m_TransitionConstantArray;
|
||||
public uint m_FullPathID;
|
||||
public bool m_isEntry;
|
||||
|
||||
public SelectorStateConstant(ObjectReader reader)
|
||||
{
|
||||
int numTransitions = reader.ReadInt32();
|
||||
m_TransitionConstantArray = new SelectorTransitionConstant[numTransitions];
|
||||
m_TransitionConstantArray = new List<SelectorTransitionConstant>();
|
||||
for (int i = 0; i < numTransitions; i++)
|
||||
{
|
||||
m_TransitionConstantArray[i] = new SelectorTransitionConstant(reader);
|
||||
m_TransitionConstantArray.Add(new SelectorTransitionConstant(reader));
|
||||
}
|
||||
|
||||
m_FullPathID = reader.ReadUInt32();
|
||||
@@ -466,9 +466,9 @@ namespace AssetStudio
|
||||
|
||||
public class StateMachineConstant
|
||||
{
|
||||
public StateConstant[] m_StateConstantArray;
|
||||
public TransitionConstant[] m_AnyStateTransitionConstantArray;
|
||||
public SelectorStateConstant[] m_SelectorStateConstantArray;
|
||||
public List<StateConstant> m_StateConstantArray;
|
||||
public List<TransitionConstant> m_AnyStateTransitionConstantArray;
|
||||
public List<SelectorStateConstant> m_SelectorStateConstantArray;
|
||||
public uint m_DefaultState;
|
||||
public uint m_MotionSetCount;
|
||||
|
||||
@@ -477,26 +477,26 @@ namespace AssetStudio
|
||||
var version = reader.version;
|
||||
|
||||
int numStates = reader.ReadInt32();
|
||||
m_StateConstantArray = new StateConstant[numStates];
|
||||
m_StateConstantArray = new List<StateConstant>();
|
||||
for (int i = 0; i < numStates; i++)
|
||||
{
|
||||
m_StateConstantArray[i] = new StateConstant(reader);
|
||||
m_StateConstantArray.Add(new StateConstant(reader));
|
||||
}
|
||||
|
||||
int numAnyStates = reader.ReadInt32();
|
||||
m_AnyStateTransitionConstantArray = new TransitionConstant[numAnyStates];
|
||||
m_AnyStateTransitionConstantArray = new List<TransitionConstant>();
|
||||
for (int i = 0; i < numAnyStates; i++)
|
||||
{
|
||||
m_AnyStateTransitionConstantArray[i] = new TransitionConstant(reader);
|
||||
m_AnyStateTransitionConstantArray.Add(new TransitionConstant(reader));
|
||||
}
|
||||
|
||||
if (version[0] >= 5) //5.0 and up
|
||||
{
|
||||
int numSelectors = reader.ReadInt32();
|
||||
m_SelectorStateConstantArray = new SelectorStateConstant[numSelectors];
|
||||
m_SelectorStateConstantArray = new List<SelectorStateConstant>();
|
||||
for (int i = 0; i < numSelectors; i++)
|
||||
{
|
||||
m_SelectorStateConstantArray[i] = new SelectorStateConstant(reader);
|
||||
m_SelectorStateConstantArray.Add(new SelectorStateConstant(reader));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -533,21 +533,11 @@ namespace AssetStudio
|
||||
}
|
||||
else
|
||||
{
|
||||
int numPosValues = reader.ReadInt32();
|
||||
m_PositionValues = new Vector3[numPosValues];
|
||||
for (int i = 0; i < numPosValues; i++)
|
||||
{
|
||||
m_PositionValues[i] = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? reader.ReadVector3() : (Vector3)reader.ReadVector4(); //5.4 and up
|
||||
}
|
||||
m_PositionValues = reader.ReadVector3Array();
|
||||
|
||||
m_QuaternionValues = reader.ReadVector4Array();
|
||||
|
||||
int numScaleValues = reader.ReadInt32();
|
||||
m_ScaleValues = new Vector3[numScaleValues];
|
||||
for (int i = 0; i < numScaleValues; i++)
|
||||
{
|
||||
m_ScaleValues[i] = version[0] > 5 || (version[0] == 5 && version[1] >= 4) ? reader.ReadVector3() : (Vector3)reader.ReadVector4(); //5.4 and up
|
||||
}
|
||||
m_ScaleValues = reader.ReadVector3Array();
|
||||
|
||||
if (version[0] > 5 || (version[0] == 5 && version[1] >= 5)) //5.5 and up
|
||||
{
|
||||
@@ -562,25 +552,25 @@ namespace AssetStudio
|
||||
|
||||
public class ControllerConstant
|
||||
{
|
||||
public LayerConstant[] m_LayerArray;
|
||||
public StateMachineConstant[] m_StateMachineArray;
|
||||
public List<LayerConstant> m_LayerArray;
|
||||
public List<StateMachineConstant> m_StateMachineArray;
|
||||
public ValueArrayConstant m_Values;
|
||||
public ValueArray m_DefaultValues;
|
||||
|
||||
public ControllerConstant(ObjectReader reader)
|
||||
{
|
||||
int numLayers = reader.ReadInt32();
|
||||
m_LayerArray = new LayerConstant[numLayers];
|
||||
m_LayerArray = new List<LayerConstant>();
|
||||
for (int i = 0; i < numLayers; i++)
|
||||
{
|
||||
m_LayerArray[i] = new LayerConstant(reader);
|
||||
m_LayerArray.Add(new LayerConstant(reader));
|
||||
}
|
||||
|
||||
int numStates = reader.ReadInt32();
|
||||
m_StateMachineArray = new StateMachineConstant[numStates];
|
||||
m_StateMachineArray = new List<StateMachineConstant>();
|
||||
for (int i = 0; i < numStates; i++)
|
||||
{
|
||||
m_StateMachineArray[i] = new StateMachineConstant(reader);
|
||||
m_StateMachineArray.Add(new StateMachineConstant(reader));
|
||||
}
|
||||
|
||||
m_Values = new ValueArrayConstant(reader);
|
||||
@@ -591,7 +581,7 @@ namespace AssetStudio
|
||||
public sealed class AnimatorController : RuntimeAnimatorController
|
||||
{
|
||||
public Dictionary<uint, string> m_TOS;
|
||||
public PPtr<AnimationClip>[] m_AnimationClips;
|
||||
public List<PPtr<AnimationClip>> m_AnimationClips;
|
||||
|
||||
public AnimatorController(ObjectReader reader) : base(reader)
|
||||
{
|
||||
@@ -599,17 +589,17 @@ namespace AssetStudio
|
||||
var m_Controller = new ControllerConstant(reader);
|
||||
|
||||
int tosSize = reader.ReadInt32();
|
||||
m_TOS = new Dictionary<uint, string>(tosSize);
|
||||
m_TOS = new Dictionary<uint, string>();
|
||||
for (int i = 0; i < tosSize; i++)
|
||||
{
|
||||
m_TOS.Add(reader.ReadUInt32(), reader.ReadAlignedString());
|
||||
}
|
||||
|
||||
int numClips = reader.ReadInt32();
|
||||
m_AnimationClips = new PPtr<AnimationClip>[numClips];
|
||||
m_AnimationClips = new List<PPtr<AnimationClip>>();
|
||||
for (int i = 0; i < numClips; i++)
|
||||
{
|
||||
m_AnimationClips[i] = new PPtr<AnimationClip>(reader);
|
||||
m_AnimationClips.Add(new PPtr<AnimationClip>(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,17 +20,17 @@ namespace AssetStudio
|
||||
public sealed class AnimatorOverrideController : RuntimeAnimatorController
|
||||
{
|
||||
public PPtr<RuntimeAnimatorController> m_Controller;
|
||||
public AnimationClipOverride[] m_Clips;
|
||||
public List<AnimationClipOverride> m_Clips;
|
||||
|
||||
public AnimatorOverrideController(ObjectReader reader) : base(reader)
|
||||
{
|
||||
m_Controller = new PPtr<RuntimeAnimatorController>(reader);
|
||||
|
||||
int numOverrides = reader.ReadInt32();
|
||||
m_Clips = new AnimationClipOverride[numOverrides];
|
||||
m_Clips = new List<AnimationClipOverride>();
|
||||
for (int i = 0; i < numOverrides; i++)
|
||||
{
|
||||
m_Clips[i] = new AnimationClipOverride(reader);
|
||||
m_Clips.Add(new AnimationClipOverride(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,64 +22,24 @@ namespace AssetStudio
|
||||
|
||||
public sealed class AssetBundle : NamedObject
|
||||
{
|
||||
public PPtr<Object>[] m_PreloadTable;
|
||||
public KeyValuePair<string, AssetInfo>[] m_Container;
|
||||
//public AssetInfo m_MainAsset;
|
||||
//public uint m_RuntimeComaptability;
|
||||
//public string m_AssetBundleName;
|
||||
//public string[] m_Dependencies;
|
||||
//public bool m_IsStreamedSceneAssetBundle;
|
||||
//public int m_ExplicitDataLayout;
|
||||
//public int m_PathFlags;
|
||||
//public KeyValuePair<string, string>[] m_SceneHashes;
|
||||
public List<PPtr<Object>> m_PreloadTable;
|
||||
public List<KeyValuePair<string, AssetInfo>> m_Container;
|
||||
|
||||
public AssetBundle(ObjectReader reader) : base(reader)
|
||||
{
|
||||
var m_PreloadTableSize = reader.ReadInt32();
|
||||
m_PreloadTable = new PPtr<Object>[m_PreloadTableSize];
|
||||
m_PreloadTable = new List<PPtr<Object>>();
|
||||
for (int i = 0; i < m_PreloadTableSize; i++)
|
||||
{
|
||||
m_PreloadTable[i] = new PPtr<Object>(reader);
|
||||
m_PreloadTable.Add(new PPtr<Object>(reader));
|
||||
}
|
||||
|
||||
var m_ContainerSize = reader.ReadInt32();
|
||||
m_Container = new KeyValuePair<string, AssetInfo>[m_ContainerSize];
|
||||
m_Container = new List<KeyValuePair<string, AssetInfo>>();
|
||||
for (int i = 0; i < m_ContainerSize; i++)
|
||||
{
|
||||
m_Container[i] = new KeyValuePair<string, AssetInfo>(reader.ReadAlignedString(), new AssetInfo(reader));
|
||||
m_Container.Add(new KeyValuePair<string, AssetInfo>(reader.ReadAlignedString(), new AssetInfo(reader)));
|
||||
}
|
||||
|
||||
//if (reader.Game.Type.IsMhyGroup())
|
||||
//{
|
||||
// m_MainAsset = new AssetInfo(reader);
|
||||
// m_RuntimeComaptability = reader.ReadUInt32();
|
||||
// m_AssetBundleName = reader.ReadAlignedString();
|
||||
// var dependencyCount = reader.ReadInt32();
|
||||
// m_Dependencies = new string[dependencyCount];
|
||||
// for (int k = 0; k < dependencyCount; k++)
|
||||
// {
|
||||
// m_Dependencies[k] = reader.ReadAlignedString();
|
||||
// }
|
||||
// if (reader.Game.Type.IsGIGroup())
|
||||
// {
|
||||
// m_IsStreamedSceneAssetBundle = reader.ReadBoolean();
|
||||
// reader.AlignStream();
|
||||
// if (reader.Game.Type.IsGICB3() || reader.Game.Type.IsGI())
|
||||
// {
|
||||
// m_ExplicitDataLayout = reader.ReadInt32();
|
||||
// }
|
||||
// m_PathFlags = reader.ReadInt32();
|
||||
// if (reader.Game.Type.IsGI())
|
||||
// {
|
||||
// var sceneHashCount = reader.ReadInt32();
|
||||
// m_SceneHashes = new KeyValuePair<string, string>[sceneHashCount];
|
||||
// for (int l = 0; l < sceneHashCount; l++)
|
||||
// {
|
||||
// m_SceneHashes[l] = new KeyValuePair<string, string>(reader.ReadAlignedString(), reader.ReadAlignedString());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,27 +66,26 @@ namespace AssetStudio
|
||||
|
||||
public class Skeleton
|
||||
{
|
||||
public Node[] m_Node;
|
||||
public List<Node> m_Node;
|
||||
public uint[] m_ID;
|
||||
public Axes[] m_AxesArray;
|
||||
|
||||
public List<Axes> m_AxesArray;
|
||||
|
||||
public Skeleton(ObjectReader reader)
|
||||
{
|
||||
int numNodes = reader.ReadInt32();
|
||||
m_Node = new Node[numNodes];
|
||||
m_Node = new List<Node>();
|
||||
for (int i = 0; i < numNodes; i++)
|
||||
{
|
||||
m_Node[i] = new Node(reader);
|
||||
m_Node.Add(new Node(reader));
|
||||
}
|
||||
|
||||
m_ID = reader.ReadUInt32Array();
|
||||
|
||||
int numAxes = reader.ReadInt32();
|
||||
m_AxesArray = new Axes[numAxes];
|
||||
m_AxesArray = new List<Axes>();
|
||||
for (int i = 0; i < numAxes; i++)
|
||||
{
|
||||
m_AxesArray[i] = new Axes(reader);
|
||||
m_AxesArray.Add(new Axes(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,12 +96,7 @@ namespace AssetStudio
|
||||
|
||||
public SkeletonPose(ObjectReader reader)
|
||||
{
|
||||
int numXforms = reader.ReadInt32();
|
||||
m_X = new XForm[numXforms];
|
||||
for (int i = 0; i < numXforms; i++)
|
||||
{
|
||||
m_X[i] = reader.ReadXForm(reader.version);
|
||||
}
|
||||
m_X = reader.ReadXFormArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +118,7 @@ namespace AssetStudio
|
||||
|
||||
public Handle(ObjectReader reader)
|
||||
{
|
||||
m_X = reader.ReadXForm(reader.version);
|
||||
m_X = reader.ReadXForm();
|
||||
m_ParentHumanIndex = reader.ReadUInt32();
|
||||
m_ID = reader.ReadUInt32();
|
||||
}
|
||||
@@ -144,7 +138,7 @@ namespace AssetStudio
|
||||
|
||||
public Collider(ObjectReader reader)
|
||||
{
|
||||
m_X = reader.ReadXForm(reader.version);
|
||||
m_X = reader.ReadXForm();
|
||||
m_Type = reader.ReadUInt32();
|
||||
m_XMotionType = reader.ReadUInt32();
|
||||
m_YMotionType = reader.ReadUInt32();
|
||||
@@ -163,8 +157,8 @@ namespace AssetStudio
|
||||
public SkeletonPose m_SkeletonPose;
|
||||
public Hand m_LeftHand;
|
||||
public Hand m_RightHand;
|
||||
public Handle[] m_Handles;
|
||||
public Collider[] m_ColliderArray;
|
||||
public List<Handle> m_Handles;
|
||||
public List<Collider> m_ColliderArray;
|
||||
public int[] m_HumanBoneIndex;
|
||||
public float[] m_HumanBoneMass;
|
||||
public int[] m_ColliderIndex;
|
||||
@@ -183,7 +177,7 @@ namespace AssetStudio
|
||||
public Human(ObjectReader reader)
|
||||
{
|
||||
var version = reader.version;
|
||||
m_RootX = reader.ReadXForm(reader.version);
|
||||
m_RootX = reader.ReadXForm();
|
||||
m_Skeleton = new Skeleton(reader);
|
||||
m_SkeletonPose = new SkeletonPose(reader);
|
||||
m_LeftHand = new Hand(reader);
|
||||
@@ -192,17 +186,17 @@ namespace AssetStudio
|
||||
if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down
|
||||
{
|
||||
int numHandles = reader.ReadInt32();
|
||||
m_Handles = new Handle[numHandles];
|
||||
m_Handles = new List<Handle>();
|
||||
for (int i = 0; i < numHandles; i++)
|
||||
{
|
||||
m_Handles[i] = new Handle(reader);
|
||||
m_Handles.Add(new Handle(reader));
|
||||
}
|
||||
|
||||
int numColliders = reader.ReadInt32();
|
||||
m_ColliderArray = new Collider[numColliders];
|
||||
m_ColliderArray = new List<Collider>(numColliders);
|
||||
for (int i = 0; i < numColliders; i++)
|
||||
{
|
||||
m_ColliderArray[i] = new Collider(reader);
|
||||
m_ColliderArray.Add(new Collider(reader));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +265,7 @@ namespace AssetStudio
|
||||
}
|
||||
|
||||
m_RootMotionBoneIndex = reader.ReadInt32();
|
||||
m_RootMotionBoneX = reader.ReadXForm(reader.version);
|
||||
m_RootMotionBoneX = reader.ReadXForm();
|
||||
|
||||
if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up
|
||||
{
|
||||
@@ -295,7 +289,7 @@ namespace AssetStudio
|
||||
m_Avatar = new AvatarConstant(reader);
|
||||
|
||||
int numTOS = reader.ReadInt32();
|
||||
m_TOS = new Dictionary<uint, string>(numTOS);
|
||||
m_TOS = new Dictionary<uint, string>();
|
||||
for (int i = 0; i < numTOS; i++)
|
||||
{
|
||||
m_TOS.Add(reader.ReadUInt32(), reader.ReadAlignedString());
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace AssetStudio
|
||||
{
|
||||
public sealed class GameObject : EditorExtension
|
||||
{
|
||||
public PPtr<Component>[] m_Components;
|
||||
public List<PPtr<Component>> m_Components;
|
||||
public string m_Name;
|
||||
|
||||
public Transform m_Transform;
|
||||
@@ -23,14 +23,14 @@ namespace AssetStudio
|
||||
public GameObject(ObjectReader reader) : base(reader)
|
||||
{
|
||||
int m_Component_size = reader.ReadInt32();
|
||||
m_Components = new PPtr<Component>[m_Component_size];
|
||||
m_Components = new List<PPtr<Component>>();
|
||||
for (int i = 0; i < m_Component_size; i++)
|
||||
{
|
||||
if ((version[0] == 5 && version[1] < 5) || version[0] < 5) //5.5 down
|
||||
{
|
||||
int first = reader.ReadInt32();
|
||||
}
|
||||
m_Components[i] = new PPtr<Component>(reader);
|
||||
m_Components.Add(new PPtr<Component>(reader));
|
||||
}
|
||||
|
||||
var m_Layer = reader.ReadInt32();
|
||||
|
||||
@@ -17,17 +17,17 @@ namespace AssetStudio
|
||||
public sealed class IndexObject : NamedObject
|
||||
{
|
||||
public int Count;
|
||||
public KeyValuePair<string, Index>[] AssetMap;
|
||||
public List<KeyValuePair<string, Index>> AssetMap;
|
||||
|
||||
public override string Name => "IndexObject";
|
||||
|
||||
public IndexObject(ObjectReader reader) : base(reader)
|
||||
{
|
||||
Count = reader.ReadInt32();
|
||||
AssetMap = new KeyValuePair<string, Index>[Count];
|
||||
AssetMap = new List<KeyValuePair<string, Index>>();
|
||||
for (int i = 0; i < Count; i++)
|
||||
{
|
||||
AssetMap[i] = new KeyValuePair<string, Index>(reader.ReadAlignedString(), new Index(reader));
|
||||
AssetMap.Add(new KeyValuePair<string, Index>(reader.ReadAlignedString(), new Index(reader)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,44 +22,44 @@ namespace AssetStudio
|
||||
|
||||
public class UnityPropertySheet
|
||||
{
|
||||
public KeyValuePair<string, UnityTexEnv>[] m_TexEnvs;
|
||||
public KeyValuePair<string, int>[] m_Ints;
|
||||
public KeyValuePair<string, float>[] m_Floats;
|
||||
public KeyValuePair<string, Color>[] m_Colors;
|
||||
public List<KeyValuePair<string, UnityTexEnv>> m_TexEnvs;
|
||||
public List<KeyValuePair<string, int>> m_Ints;
|
||||
public List<KeyValuePair<string, float>> m_Floats;
|
||||
public List<KeyValuePair<string, Color>> m_Colors;
|
||||
|
||||
public UnityPropertySheet(ObjectReader reader)
|
||||
{
|
||||
var version = reader.version;
|
||||
|
||||
int m_TexEnvsSize = reader.ReadInt32();
|
||||
m_TexEnvs = new KeyValuePair<string, UnityTexEnv>[m_TexEnvsSize];
|
||||
m_TexEnvs = new List<KeyValuePair<string, UnityTexEnv>>();
|
||||
for (int i = 0; i < m_TexEnvsSize; i++)
|
||||
{
|
||||
m_TexEnvs[i] = new(reader.ReadAlignedString(), new UnityTexEnv(reader));
|
||||
m_TexEnvs.Add(new(reader.ReadAlignedString(), new UnityTexEnv(reader)));
|
||||
}
|
||||
|
||||
if (version[0] >= 2021) //2021.1 and up
|
||||
{
|
||||
int m_IntsSize = reader.ReadInt32();
|
||||
m_Ints = new KeyValuePair<string, int>[m_IntsSize];
|
||||
m_Ints = new List<KeyValuePair<string, int>>();
|
||||
for (int i = 0; i < m_IntsSize; i++)
|
||||
{
|
||||
m_Ints[i] = new(reader.ReadAlignedString(), reader.ReadInt32());
|
||||
m_Ints.Add(new(reader.ReadAlignedString(), reader.ReadInt32()));
|
||||
}
|
||||
}
|
||||
|
||||
int m_FloatsSize = reader.ReadInt32();
|
||||
m_Floats = new KeyValuePair<string, float>[m_FloatsSize];
|
||||
m_Floats = new List<KeyValuePair<string, float>>();
|
||||
for (int i = 0; i < m_FloatsSize; i++)
|
||||
{
|
||||
m_Floats[i] = new(reader.ReadAlignedString(), reader.ReadSingle());
|
||||
m_Floats.Add(new(reader.ReadAlignedString(), reader.ReadSingle()));
|
||||
}
|
||||
|
||||
int m_ColorsSize = reader.ReadInt32();
|
||||
m_Colors = new KeyValuePair<string, Color>[m_ColorsSize];
|
||||
m_Colors = new List<KeyValuePair<string, Color>>();
|
||||
for (int i = 0; i < m_ColorsSize; i++)
|
||||
{
|
||||
m_Colors[i] = new(reader.ReadAlignedString(), reader.ReadColor4());
|
||||
m_Colors.Add(new(reader.ReadAlignedString(), reader.ReadColor4()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace AssetStudio
|
||||
public Vector3 m_Min;
|
||||
public Vector3 m_Max;
|
||||
|
||||
public MinMaxAABB(EndianBinaryReader reader)
|
||||
public MinMaxAABB(ObjectReader reader)
|
||||
{
|
||||
m_Min = reader.ReadVector3();
|
||||
m_Max = reader.ReadVector3();
|
||||
@@ -124,8 +124,8 @@ namespace AssetStudio
|
||||
{
|
||||
public uint m_CurrentChannels;
|
||||
public uint m_VertexCount;
|
||||
public ChannelInfo[] m_Channels;
|
||||
public StreamInfo[] m_Streams;
|
||||
public List<ChannelInfo> m_Channels;
|
||||
public List<StreamInfo> m_Streams;
|
||||
public byte[] m_DataSize;
|
||||
|
||||
public VertexData(ObjectReader reader)
|
||||
@@ -142,25 +142,18 @@ namespace AssetStudio
|
||||
if (version[0] >= 4) //4.0 and up
|
||||
{
|
||||
var m_ChannelsSize = reader.ReadInt32();
|
||||
m_Channels = new ChannelInfo[m_ChannelsSize];
|
||||
m_Channels = new List<ChannelInfo>();
|
||||
for (int i = 0; i < m_ChannelsSize; i++)
|
||||
{
|
||||
m_Channels[i] = new ChannelInfo(reader);
|
||||
m_Channels.Add(new ChannelInfo(reader));
|
||||
}
|
||||
}
|
||||
|
||||
if (version[0] < 5) //5.0 down
|
||||
{
|
||||
if (version[0] < 4)
|
||||
{
|
||||
m_Streams = new StreamInfo[4];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Streams = new StreamInfo[reader.ReadInt32()];
|
||||
}
|
||||
|
||||
for (int i = 0; i < m_Streams.Length; i++)
|
||||
var numStreams = version[0] < 4 ? 4 : reader.ReadInt32();
|
||||
m_Streams = new List<StreamInfo>();
|
||||
for (int i = 0; i < numStreams; i++)
|
||||
{
|
||||
m_Streams[i] = new StreamInfo(reader);
|
||||
}
|
||||
@@ -182,13 +175,13 @@ namespace AssetStudio
|
||||
private void GetStreams(int[] version)
|
||||
{
|
||||
var streamCount = m_Channels.Max(x => x.stream) + 1;
|
||||
m_Streams = new StreamInfo[streamCount];
|
||||
m_Streams = new List<StreamInfo>();
|
||||
uint offset = 0;
|
||||
for (int s = 0; s < streamCount; s++)
|
||||
{
|
||||
uint chnMask = 0;
|
||||
uint stride = 0;
|
||||
for (int chn = 0; chn < m_Channels.Length; chn++)
|
||||
for (int chn = 0; chn < m_Channels.Count; chn++)
|
||||
{
|
||||
var m_Channel = m_Channels[chn];
|
||||
if (m_Channel.stream == s)
|
||||
@@ -200,14 +193,14 @@ namespace AssetStudio
|
||||
}
|
||||
}
|
||||
}
|
||||
m_Streams[s] = new StreamInfo
|
||||
m_Streams.Add(new StreamInfo
|
||||
{
|
||||
channelMask = chnMask,
|
||||
offset = offset,
|
||||
stride = stride,
|
||||
dividerOp = 0,
|
||||
frequency = 0
|
||||
};
|
||||
});
|
||||
offset += m_VertexCount * stride;
|
||||
//static size_t AlignStreamSize (size_t size) { return (size + (kVertexStreamAlign-1)) & ~(kVertexStreamAlign-1); }
|
||||
offset = (offset + (16u - 1u)) & ~(16u - 1u);
|
||||
@@ -216,12 +209,12 @@ namespace AssetStudio
|
||||
|
||||
private void GetChannels(int[] version)
|
||||
{
|
||||
m_Channels = new ChannelInfo[6];
|
||||
m_Channels = new List<ChannelInfo>(6);
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
m_Channels[i] = new ChannelInfo();
|
||||
m_Channels.Add(new ChannelInfo());
|
||||
}
|
||||
for (var s = 0; s < m_Streams.Length; s++)
|
||||
for (var s = 0; s < m_Streams.Count; s++)
|
||||
{
|
||||
var m_Stream = m_Streams[s];
|
||||
var channelMask = new BitArray(new[] { (int)m_Stream.channelMask });
|
||||
@@ -345,9 +338,9 @@ namespace AssetStudio
|
||||
|
||||
public class BlendShapeData
|
||||
{
|
||||
public BlendShapeVertex[] vertices;
|
||||
public MeshBlendShape[] shapes;
|
||||
public MeshBlendShapeChannel[] channels;
|
||||
public List<BlendShapeVertex> vertices;
|
||||
public List<MeshBlendShape> shapes;
|
||||
public List<MeshBlendShapeChannel> channels;
|
||||
public float[] fullWeights;
|
||||
|
||||
public BlendShapeData(ObjectReader reader)
|
||||
@@ -357,24 +350,24 @@ namespace AssetStudio
|
||||
if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up
|
||||
{
|
||||
int numVerts = reader.ReadInt32();
|
||||
vertices = new BlendShapeVertex[numVerts];
|
||||
vertices = new List<BlendShapeVertex>();
|
||||
for (int i = 0; i < numVerts; i++)
|
||||
{
|
||||
vertices[i] = new BlendShapeVertex(reader);
|
||||
vertices.Add(new BlendShapeVertex(reader));
|
||||
}
|
||||
|
||||
int numShapes = reader.ReadInt32();
|
||||
shapes = new MeshBlendShape[numShapes];
|
||||
shapes = new List<MeshBlendShape>();
|
||||
for (int i = 0; i < numShapes; i++)
|
||||
{
|
||||
shapes[i] = new MeshBlendShape(reader);
|
||||
shapes.Add(new MeshBlendShape(reader));
|
||||
}
|
||||
|
||||
int numChannels = reader.ReadInt32();
|
||||
channels = new MeshBlendShapeChannel[numChannels];
|
||||
channels = new List<MeshBlendShapeChannel>();
|
||||
for (int i = 0; i < numChannels; i++)
|
||||
{
|
||||
channels[i] = new MeshBlendShapeChannel(reader);
|
||||
channels.Add(new MeshBlendShapeChannel(reader));
|
||||
}
|
||||
|
||||
fullWeights = reader.ReadSingleArray();
|
||||
@@ -382,17 +375,17 @@ namespace AssetStudio
|
||||
else
|
||||
{
|
||||
var m_ShapesSize = reader.ReadInt32();
|
||||
var m_Shapes = new MeshBlendShape[m_ShapesSize];
|
||||
var m_Shapes = new List<MeshBlendShape>();
|
||||
for (int i = 0; i < m_ShapesSize; i++)
|
||||
{
|
||||
m_Shapes[i] = new MeshBlendShape(reader);
|
||||
m_Shapes.Add(new MeshBlendShape(reader));
|
||||
}
|
||||
reader.AlignStream();
|
||||
var m_ShapeVerticesSize = reader.ReadInt32();
|
||||
var m_ShapeVertices = new BlendShapeVertex[m_ShapeVerticesSize]; //MeshBlendShapeVertex
|
||||
var m_ShapeVertices = new List<BlendShapeVertex>(); //MeshBlendShapeVertex
|
||||
for (int i = 0; i < m_ShapeVerticesSize; i++)
|
||||
{
|
||||
m_ShapeVertices[i] = new BlendShapeVertex(reader);
|
||||
m_ShapeVertices.Add(new BlendShapeVertex(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -449,14 +442,14 @@ namespace AssetStudio
|
||||
public sealed class Mesh : NamedObject
|
||||
{
|
||||
private bool m_Use16BitIndices = true;
|
||||
public SubMesh[] m_SubMeshes;
|
||||
public List<SubMesh> m_SubMeshes;
|
||||
private uint[] m_IndexBuffer;
|
||||
public BlendShapeData m_Shapes;
|
||||
public Matrix4x4[] m_BindPose;
|
||||
public uint[] m_BoneNameHashes;
|
||||
public int m_VertexCount;
|
||||
public float[] m_Vertices;
|
||||
public BoneWeights4[] m_Skin;
|
||||
public List<BoneWeights4> m_Skin;
|
||||
public float[] m_Normals;
|
||||
public float[] m_Colors;
|
||||
public float[] m_UV0;
|
||||
@@ -502,10 +495,10 @@ namespace AssetStudio
|
||||
}
|
||||
|
||||
int m_SubMeshesSize = reader.ReadInt32();
|
||||
m_SubMeshes = new SubMesh[m_SubMeshesSize];
|
||||
m_SubMeshes = new List<SubMesh>();
|
||||
for (int i = 0; i < m_SubMeshesSize; i++)
|
||||
{
|
||||
m_SubMeshes[i] = new SubMesh(reader);
|
||||
m_SubMeshes.Add(new SubMesh(reader));
|
||||
}
|
||||
|
||||
if (version[0] > 4 || (version[0] == 4 && version[1] >= 1)) //4.1 and up
|
||||
@@ -525,10 +518,10 @@ namespace AssetStudio
|
||||
if (version[0] >= 2019) //2019 and up
|
||||
{
|
||||
var m_BonesAABBSize = reader.ReadInt32();
|
||||
var m_BonesAABB = new MinMaxAABB[m_BonesAABBSize];
|
||||
var m_BonesAABB = new List<MinMaxAABB>();
|
||||
for (int i = 0; i < m_BonesAABBSize; i++)
|
||||
{
|
||||
m_BonesAABB[i] = new MinMaxAABB(reader);
|
||||
m_BonesAABB.Add(new MinMaxAABB(reader));
|
||||
}
|
||||
|
||||
var m_VariableBoneCountWeights = reader.ReadUInt32Array();
|
||||
@@ -594,10 +587,11 @@ namespace AssetStudio
|
||||
m_VertexCount = reader.ReadInt32();
|
||||
m_Vertices = reader.ReadSingleArray(m_VertexCount * 3); //Vector3
|
||||
|
||||
m_Skin = new BoneWeights4[reader.ReadInt32()];
|
||||
for (int s = 0; s < m_Skin.Length; s++)
|
||||
var skinNum = reader.ReadInt32();
|
||||
m_Skin = new List<BoneWeights4>();
|
||||
for (int s = 0; s < skinNum; s++)
|
||||
{
|
||||
m_Skin[s] = new BoneWeights4(reader);
|
||||
m_Skin.Add(new BoneWeights4(reader));
|
||||
}
|
||||
|
||||
m_BindPose = reader.ReadMatrixArray();
|
||||
@@ -633,10 +627,11 @@ namespace AssetStudio
|
||||
{
|
||||
if (version[0] < 2018 || (version[0] == 2018 && version[1] < 2)) //2018.2 down
|
||||
{
|
||||
m_Skin = new BoneWeights4[reader.ReadInt32()];
|
||||
for (int s = 0; s < m_Skin.Length; s++)
|
||||
var skinNum = reader.ReadInt32();
|
||||
m_Skin = new List<BoneWeights4>();
|
||||
for (int s = 0; s < skinNum; s++)
|
||||
{
|
||||
m_Skin[s] = new BoneWeights4(reader);
|
||||
m_Skin.Add(new BoneWeights4(reader));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -763,7 +758,7 @@ namespace AssetStudio
|
||||
{
|
||||
m_VertexCount = (int)m_VertexData.m_VertexCount;
|
||||
|
||||
for (var chn = 0; chn < m_VertexData.m_Channels.Length; chn++)
|
||||
for (var chn = 0; chn < m_VertexData.m_Channels.Count; chn++)
|
||||
{
|
||||
var m_Channel = m_VertexData.m_Channels[chn];
|
||||
if (m_Channel.dimension > 0)
|
||||
@@ -1184,10 +1179,10 @@ namespace AssetStudio
|
||||
|
||||
private void InitMSkin()
|
||||
{
|
||||
m_Skin = new BoneWeights4[m_VertexCount];
|
||||
m_Skin = new List<BoneWeights4>();
|
||||
for (int i = 0; i < m_VertexCount; i++)
|
||||
{
|
||||
m_Skin[i] = new BoneWeights4();
|
||||
m_Skin.Add(new BoneWeights4());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ namespace AssetStudio
|
||||
|
||||
public MiHoYoBinData(ObjectReader reader) : base(reader)
|
||||
{
|
||||
var length = reader.ReadInt32();
|
||||
RawData = reader.ReadBytes(length);
|
||||
RawData = reader.ReadUInt8Array();
|
||||
}
|
||||
|
||||
public string AsString => Type switch
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace AssetStudio
|
||||
{
|
||||
public static bool Parsable;
|
||||
|
||||
public PPtr<Material>[] m_Materials;
|
||||
public List<PPtr<Material>> m_Materials;
|
||||
public StaticBatchInfo m_StaticBatchInfo;
|
||||
public uint[] m_SubsetIndices;
|
||||
private bool isNewHeader = false;
|
||||
@@ -165,10 +165,10 @@ namespace AssetStudio
|
||||
var m_ShaderLODDistanceRatio = reader.ReadSingle();
|
||||
}
|
||||
var m_MaterialsSize = reader.ReadInt32();
|
||||
m_Materials = new PPtr<Material>[m_MaterialsSize];
|
||||
m_Materials = new List<PPtr<Material>>();
|
||||
for (int i = 0; i < m_MaterialsSize; i++)
|
||||
{
|
||||
m_Materials[i] = new PPtr<Material>(reader);
|
||||
m_Materials.Add(new PPtr<Material>(reader));
|
||||
}
|
||||
|
||||
if (version[0] < 3) //3.0 down
|
||||
|
||||
@@ -4,15 +4,15 @@ namespace AssetStudio
|
||||
{
|
||||
public class ResourceManager : Object
|
||||
{
|
||||
public KeyValuePair<string, PPtr<Object>>[] m_Container;
|
||||
public List<KeyValuePair<string, PPtr<Object>>> m_Container;
|
||||
|
||||
public ResourceManager(ObjectReader reader) : base(reader)
|
||||
{
|
||||
var m_ContainerSize = reader.ReadInt32();
|
||||
m_Container = new KeyValuePair<string, PPtr<Object>>[m_ContainerSize];
|
||||
m_Container = new List<KeyValuePair<string, PPtr<Object>>>();
|
||||
for (int i = 0; i < m_ContainerSize; i++)
|
||||
{
|
||||
m_Container[i] = new KeyValuePair<string, PPtr<Object>>(reader.ReadAlignedString(), new PPtr<Object>(reader));
|
||||
m_Container.Add(new KeyValuePair<string, PPtr<Object>>(reader.ReadAlignedString(), new PPtr<Object>(reader)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ namespace AssetStudio
|
||||
|
||||
public class StructParameter
|
||||
{
|
||||
public MatrixParameter[] m_MatrixParams;
|
||||
public VectorParameter[] m_VectorParams;
|
||||
public List<MatrixParameter> m_MatrixParams;
|
||||
public List<VectorParameter> m_VectorParams;
|
||||
|
||||
public StructParameter(EndianBinaryReader reader)
|
||||
{
|
||||
@@ -29,17 +29,17 @@ namespace AssetStudio
|
||||
var m_StructSize = reader.ReadInt32();
|
||||
|
||||
int numVectorParams = reader.ReadInt32();
|
||||
m_VectorParams = new VectorParameter[numVectorParams];
|
||||
m_VectorParams = new List<VectorParameter>();
|
||||
for (int i = 0; i < numVectorParams; i++)
|
||||
{
|
||||
m_VectorParams[i] = new VectorParameter(reader);
|
||||
m_VectorParams.Add(new VectorParameter(reader));
|
||||
}
|
||||
|
||||
int numMatrixParams = reader.ReadInt32();
|
||||
m_MatrixParams = new MatrixParameter[numMatrixParams];
|
||||
m_MatrixParams = new List<MatrixParameter>();
|
||||
for (int i = 0; i < numMatrixParams; i++)
|
||||
{
|
||||
m_MatrixParams[i] = new MatrixParameter(reader);
|
||||
m_MatrixParams.Add(new MatrixParameter(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,15 +113,15 @@ namespace AssetStudio
|
||||
|
||||
public class SerializedProperties
|
||||
{
|
||||
public SerializedProperty[] m_Props;
|
||||
public List<SerializedProperty> m_Props;
|
||||
|
||||
public SerializedProperties(EndianBinaryReader reader)
|
||||
{
|
||||
int numProps = reader.ReadInt32();
|
||||
m_Props = new SerializedProperty[numProps];
|
||||
m_Props = new List<SerializedProperty>();
|
||||
for (int i = 0; i < numProps; i++)
|
||||
{
|
||||
m_Props[i] = new SerializedProperty(reader);
|
||||
m_Props.Add(new SerializedProperty(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -206,7 +206,7 @@ namespace AssetStudio
|
||||
public class SerializedShaderState
|
||||
{
|
||||
public string m_Name;
|
||||
public SerializedShaderRTBlendState[] rtBlend;
|
||||
public List<SerializedShaderRTBlendState> rtBlend;
|
||||
public bool rtSeparateBlend;
|
||||
public SerializedShaderFloatValue zClip;
|
||||
public SerializedShaderFloatValue zTest;
|
||||
@@ -237,10 +237,10 @@ namespace AssetStudio
|
||||
var version = reader.version;
|
||||
|
||||
m_Name = reader.ReadAlignedString();
|
||||
rtBlend = new SerializedShaderRTBlendState[8];
|
||||
rtBlend = new List<SerializedShaderRTBlendState>();
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
rtBlend[i] = new SerializedShaderRTBlendState(reader);
|
||||
rtBlend.Add(new SerializedShaderRTBlendState(reader));
|
||||
}
|
||||
rtSeparateBlend = reader.ReadBoolean();
|
||||
reader.AlignStream();
|
||||
@@ -291,16 +291,16 @@ namespace AssetStudio
|
||||
|
||||
public class ParserBindChannels
|
||||
{
|
||||
public ShaderBindChannel[] m_Channels;
|
||||
public List<ShaderBindChannel> m_Channels;
|
||||
public uint m_SourceMap;
|
||||
|
||||
public ParserBindChannels(EndianBinaryReader reader)
|
||||
{
|
||||
int numChannels = reader.ReadInt32();
|
||||
m_Channels = new ShaderBindChannel[numChannels];
|
||||
m_Channels = new List<ShaderBindChannel>();
|
||||
for (int i = 0; i < numChannels; i++)
|
||||
{
|
||||
m_Channels[i] = new ShaderBindChannel(reader);
|
||||
m_Channels.Add(new ShaderBindChannel(reader));
|
||||
}
|
||||
reader.AlignStream();
|
||||
|
||||
@@ -391,9 +391,9 @@ namespace AssetStudio
|
||||
public class ConstantBuffer
|
||||
{
|
||||
public int m_NameIndex;
|
||||
public MatrixParameter[] m_MatrixParams;
|
||||
public VectorParameter[] m_VectorParams;
|
||||
public StructParameter[] m_StructParams;
|
||||
public List<MatrixParameter> m_MatrixParams;
|
||||
public List<VectorParameter> m_VectorParams;
|
||||
public List<StructParameter> m_StructParams;
|
||||
public int m_Size;
|
||||
public bool m_IsPartialCB;
|
||||
|
||||
@@ -404,25 +404,25 @@ namespace AssetStudio
|
||||
m_NameIndex = reader.ReadInt32();
|
||||
|
||||
int numMatrixParams = reader.ReadInt32();
|
||||
m_MatrixParams = new MatrixParameter[numMatrixParams];
|
||||
m_MatrixParams = new List<MatrixParameter>();
|
||||
for (int i = 0; i < numMatrixParams; i++)
|
||||
{
|
||||
m_MatrixParams[i] = new MatrixParameter(reader);
|
||||
m_MatrixParams.Add(new MatrixParameter(reader));
|
||||
}
|
||||
|
||||
int numVectorParams = reader.ReadInt32();
|
||||
m_VectorParams = new VectorParameter[numVectorParams];
|
||||
m_VectorParams = new List<VectorParameter>();
|
||||
for (int i = 0; i < numVectorParams; i++)
|
||||
{
|
||||
m_VectorParams[i] = new VectorParameter(reader);
|
||||
m_VectorParams.Add(new VectorParameter(reader));
|
||||
}
|
||||
if (version[0] > 2017 || (version[0] == 2017 && version[1] >= 3)) //2017.3 and up
|
||||
{
|
||||
int numStructParams = reader.ReadInt32();
|
||||
m_StructParams = new StructParameter[numStructParams];
|
||||
m_StructParams = new List<StructParameter>();
|
||||
for (int i = 0; i < numStructParams; i++)
|
||||
{
|
||||
m_StructParams[i] = new StructParameter(reader);
|
||||
m_StructParams.Add(new StructParameter(reader));
|
||||
}
|
||||
}
|
||||
m_Size = reader.ReadInt32();
|
||||
@@ -492,71 +492,71 @@ namespace AssetStudio
|
||||
|
||||
public class SerializedProgramParameters
|
||||
{
|
||||
public VectorParameter[] m_VectorParams;
|
||||
public MatrixParameter[] m_MatrixParams;
|
||||
public TextureParameter[] m_TextureParams;
|
||||
public BufferBinding[] m_BufferParams;
|
||||
public ConstantBuffer[] m_ConstantBuffers;
|
||||
public BufferBinding[] m_ConstantBufferBindings;
|
||||
public UAVParameter[] m_UAVParams;
|
||||
public SamplerParameter[] m_Samplers;
|
||||
public List<VectorParameter> m_VectorParams;
|
||||
public List<MatrixParameter> m_MatrixParams;
|
||||
public List<TextureParameter> m_TextureParams;
|
||||
public List<BufferBinding> m_BufferParams;
|
||||
public List<ConstantBuffer> m_ConstantBuffers;
|
||||
public List<BufferBinding> m_ConstantBufferBindings;
|
||||
public List<UAVParameter> m_UAVParams;
|
||||
public List<SamplerParameter> m_Samplers;
|
||||
|
||||
public SerializedProgramParameters(ObjectReader reader)
|
||||
{
|
||||
int numVectorParams = reader.ReadInt32();
|
||||
m_VectorParams = new VectorParameter[numVectorParams];
|
||||
m_VectorParams = new List<VectorParameter>();
|
||||
for (int i = 0; i < numVectorParams; i++)
|
||||
{
|
||||
m_VectorParams[i] = new VectorParameter(reader);
|
||||
m_VectorParams.Add(new VectorParameter(reader));
|
||||
}
|
||||
|
||||
int numMatrixParams = reader.ReadInt32();
|
||||
m_MatrixParams = new MatrixParameter[numMatrixParams];
|
||||
m_MatrixParams = new List<MatrixParameter>();
|
||||
for (int i = 0; i < numMatrixParams; i++)
|
||||
{
|
||||
m_MatrixParams[i] = new MatrixParameter(reader);
|
||||
m_MatrixParams.Add(new MatrixParameter(reader));
|
||||
}
|
||||
|
||||
int numTextureParams = reader.ReadInt32();
|
||||
m_TextureParams = new TextureParameter[numTextureParams];
|
||||
m_TextureParams = new List<TextureParameter>();
|
||||
for (int i = 0; i < numTextureParams; i++)
|
||||
{
|
||||
m_TextureParams[i] = new TextureParameter(reader);
|
||||
m_TextureParams.Add(new TextureParameter(reader));
|
||||
}
|
||||
|
||||
int numBufferParams = reader.ReadInt32();
|
||||
m_BufferParams = new BufferBinding[numBufferParams];
|
||||
m_BufferParams = new List<BufferBinding>();
|
||||
for (int i = 0; i < numBufferParams; i++)
|
||||
{
|
||||
m_BufferParams[i] = new BufferBinding(reader);
|
||||
m_BufferParams.Add(new BufferBinding(reader));
|
||||
}
|
||||
|
||||
int numConstantBuffers = reader.ReadInt32();
|
||||
m_ConstantBuffers = new ConstantBuffer[numConstantBuffers];
|
||||
m_ConstantBuffers = new List<ConstantBuffer>();
|
||||
for (int i = 0; i < numConstantBuffers; i++)
|
||||
{
|
||||
m_ConstantBuffers[i] = new ConstantBuffer(reader);
|
||||
m_ConstantBuffers.Add(new ConstantBuffer(reader));
|
||||
}
|
||||
|
||||
int numConstantBufferBindings = reader.ReadInt32();
|
||||
m_ConstantBufferBindings = new BufferBinding[numConstantBufferBindings];
|
||||
m_ConstantBufferBindings = new List<BufferBinding>();
|
||||
for (int i = 0; i < numConstantBufferBindings; i++)
|
||||
{
|
||||
m_ConstantBufferBindings[i] = new BufferBinding(reader);
|
||||
m_ConstantBufferBindings.Add(new BufferBinding(reader));
|
||||
}
|
||||
|
||||
int numUAVParams = reader.ReadInt32();
|
||||
m_UAVParams = new UAVParameter[numUAVParams];
|
||||
m_UAVParams = new List<UAVParameter>();
|
||||
for (int i = 0; i < numUAVParams; i++)
|
||||
{
|
||||
m_UAVParams[i] = new UAVParameter(reader);
|
||||
m_UAVParams.Add(new UAVParameter(reader));
|
||||
}
|
||||
|
||||
int numSamplers = reader.ReadInt32();
|
||||
m_Samplers = new SamplerParameter[numSamplers];
|
||||
m_Samplers = new List<SamplerParameter>();
|
||||
for (int i = 0; i < numSamplers; i++)
|
||||
{
|
||||
m_Samplers[i] = new SamplerParameter(reader);
|
||||
m_Samplers.Add(new SamplerParameter(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -569,14 +569,14 @@ namespace AssetStudio
|
||||
public sbyte m_ShaderHardwareTier;
|
||||
public ShaderGpuProgramType m_GpuProgramType;
|
||||
public SerializedProgramParameters m_Parameters;
|
||||
public VectorParameter[] m_VectorParams;
|
||||
public MatrixParameter[] m_MatrixParams;
|
||||
public TextureParameter[] m_TextureParams;
|
||||
public BufferBinding[] m_BufferParams;
|
||||
public ConstantBuffer[] m_ConstantBuffers;
|
||||
public BufferBinding[] m_ConstantBufferBindings;
|
||||
public UAVParameter[] m_UAVParams;
|
||||
public SamplerParameter[] m_Samplers;
|
||||
public List<VectorParameter> m_VectorParams;
|
||||
public List<MatrixParameter> m_MatrixParams;
|
||||
public List<TextureParameter> m_TextureParams;
|
||||
public List<BufferBinding> m_BufferParams;
|
||||
public List<ConstantBuffer> m_ConstantBuffers;
|
||||
public List<BufferBinding> m_ConstantBufferBindings;
|
||||
public List<UAVParameter> m_UAVParams;
|
||||
public List<SamplerParameter> m_Samplers;
|
||||
|
||||
public static bool HasGlobalLocalKeywordIndices(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A", "450A058C218DAF000647948F2F59DA6D");
|
||||
public static bool HasInstancedStructuredBuffers(SerializedType type) => type.Match("E99740711222CD922E9A6F92FF1EB07A");
|
||||
@@ -630,61 +630,61 @@ namespace AssetStudio
|
||||
else
|
||||
{
|
||||
int numVectorParams = reader.ReadInt32();
|
||||
m_VectorParams = new VectorParameter[numVectorParams];
|
||||
m_VectorParams = new List<VectorParameter>();
|
||||
for (int i = 0; i < numVectorParams; i++)
|
||||
{
|
||||
m_VectorParams[i] = new VectorParameter(reader);
|
||||
m_VectorParams.Add(new VectorParameter(reader));
|
||||
}
|
||||
|
||||
int numMatrixParams = reader.ReadInt32();
|
||||
m_MatrixParams = new MatrixParameter[numMatrixParams];
|
||||
m_MatrixParams = new List<MatrixParameter>();
|
||||
for (int i = 0; i < numMatrixParams; i++)
|
||||
{
|
||||
m_MatrixParams[i] = new MatrixParameter(reader);
|
||||
m_MatrixParams.Add(new MatrixParameter(reader));
|
||||
}
|
||||
|
||||
int numTextureParams = reader.ReadInt32();
|
||||
m_TextureParams = new TextureParameter[numTextureParams];
|
||||
m_TextureParams = new List<TextureParameter>();
|
||||
for (int i = 0; i < numTextureParams; i++)
|
||||
{
|
||||
m_TextureParams[i] = new TextureParameter(reader);
|
||||
m_TextureParams.Add(new TextureParameter(reader));
|
||||
}
|
||||
|
||||
int numBufferParams = reader.ReadInt32();
|
||||
m_BufferParams = new BufferBinding[numBufferParams];
|
||||
m_BufferParams = new List<BufferBinding>();
|
||||
for (int i = 0; i < numBufferParams; i++)
|
||||
{
|
||||
m_BufferParams[i] = new BufferBinding(reader);
|
||||
m_BufferParams.Add(new BufferBinding(reader));
|
||||
}
|
||||
|
||||
int numConstantBuffers = reader.ReadInt32();
|
||||
m_ConstantBuffers = new ConstantBuffer[numConstantBuffers];
|
||||
m_ConstantBuffers = new List<ConstantBuffer>();
|
||||
for (int i = 0; i < numConstantBuffers; i++)
|
||||
{
|
||||
m_ConstantBuffers[i] = new ConstantBuffer(reader);
|
||||
m_ConstantBuffers.Add(new ConstantBuffer(reader));
|
||||
}
|
||||
|
||||
int numConstantBufferBindings = reader.ReadInt32();
|
||||
m_ConstantBufferBindings = new BufferBinding[numConstantBufferBindings];
|
||||
m_ConstantBufferBindings = new List<BufferBinding>();
|
||||
for (int i = 0; i < numConstantBufferBindings; i++)
|
||||
{
|
||||
m_ConstantBufferBindings[i] = new BufferBinding(reader);
|
||||
m_ConstantBufferBindings.Add(new BufferBinding(reader));
|
||||
}
|
||||
|
||||
int numUAVParams = reader.ReadInt32();
|
||||
m_UAVParams = new UAVParameter[numUAVParams];
|
||||
m_UAVParams = new List<UAVParameter>();
|
||||
for (int i = 0; i < numUAVParams; i++)
|
||||
{
|
||||
m_UAVParams[i] = new UAVParameter(reader);
|
||||
m_UAVParams.Add(new UAVParameter(reader));
|
||||
}
|
||||
|
||||
if (version[0] >= 2017) //2017 and up
|
||||
{
|
||||
int numSamplers = reader.ReadInt32();
|
||||
m_Samplers = new SamplerParameter[numSamplers];
|
||||
m_Samplers = new List<SamplerParameter>();
|
||||
for (int i = 0; i < numSamplers; i++)
|
||||
{
|
||||
m_Samplers[i] = new SamplerParameter(reader);
|
||||
m_Samplers.Add(new SamplerParameter(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -704,10 +704,10 @@ namespace AssetStudio
|
||||
if (HasInstancedStructuredBuffers(reader.serializedType))
|
||||
{
|
||||
int numInstancedStructuredBuffers = reader.ReadInt32();
|
||||
var m_InstancedStructuredBuffers = new ConstantBuffer[numInstancedStructuredBuffers];
|
||||
var m_InstancedStructuredBuffers = new List<ConstantBuffer>();
|
||||
for (int i = 0; i < numInstancedStructuredBuffers; i++)
|
||||
{
|
||||
m_InstancedStructuredBuffers[i] = new ConstantBuffer(reader);
|
||||
m_InstancedStructuredBuffers.Add(new ConstantBuffer(reader));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -715,7 +715,7 @@ namespace AssetStudio
|
||||
|
||||
public class SerializedProgram
|
||||
{
|
||||
public SerializedSubProgram[] m_SubPrograms;
|
||||
public List<SerializedSubProgram> m_SubPrograms;
|
||||
public SerializedProgramParameters m_CommonParameters;
|
||||
public ushort[] m_SerializedKeywordStateMask;
|
||||
|
||||
@@ -724,10 +724,10 @@ namespace AssetStudio
|
||||
var version = reader.version;
|
||||
|
||||
int numSubPrograms = reader.ReadInt32();
|
||||
m_SubPrograms = new SerializedSubProgram[numSubPrograms];
|
||||
m_SubPrograms = new List<SerializedSubProgram>();
|
||||
for (int i = 0; i < numSubPrograms; i++)
|
||||
{
|
||||
m_SubPrograms[i] = new SerializedSubProgram(reader);
|
||||
m_SubPrograms.Add(new SerializedSubProgram(reader));
|
||||
}
|
||||
|
||||
if ((version[0] == 2020 && version[1] > 3) ||
|
||||
@@ -756,11 +756,11 @@ namespace AssetStudio
|
||||
|
||||
public class SerializedPass
|
||||
{
|
||||
public Hash128[] m_EditorDataHash;
|
||||
public List<Hash128> m_EditorDataHash;
|
||||
public byte[] m_Platforms;
|
||||
public ushort[] m_LocalKeywordMask;
|
||||
public ushort[] m_GlobalKeywordMask;
|
||||
public KeyValuePair<string, int>[] m_NameIndices;
|
||||
public List<KeyValuePair<string, int>> m_NameIndices;
|
||||
public PassType m_Type;
|
||||
public SerializedShaderState m_State;
|
||||
public uint m_ProgramMask;
|
||||
@@ -784,10 +784,10 @@ namespace AssetStudio
|
||||
if (version[0] > 2020 || (version[0] == 2020 && version[1] >= 2)) //2020.2 and up
|
||||
{
|
||||
int numEditorDataHash = reader.ReadInt32();
|
||||
m_EditorDataHash = new Hash128[numEditorDataHash];
|
||||
m_EditorDataHash = new List<Hash128>();
|
||||
for (int i = 0; i < numEditorDataHash; i++)
|
||||
{
|
||||
m_EditorDataHash[i] = new Hash128(reader);
|
||||
m_EditorDataHash.Add(new Hash128(reader));
|
||||
}
|
||||
reader.AlignStream();
|
||||
m_Platforms = reader.ReadUInt8Array();
|
||||
@@ -802,10 +802,10 @@ namespace AssetStudio
|
||||
}
|
||||
|
||||
int numIndices = reader.ReadInt32();
|
||||
m_NameIndices = new KeyValuePair<string, int>[numIndices];
|
||||
m_NameIndices = new List<KeyValuePair<string, int>>();
|
||||
for (int i = 0; i < numIndices; i++)
|
||||
{
|
||||
m_NameIndices[i] = new KeyValuePair<string, int>(reader.ReadAlignedString(), reader.ReadInt32());
|
||||
m_NameIndices.Add(new KeyValuePair<string, int>(reader.ReadAlignedString(), reader.ReadInt32()));
|
||||
}
|
||||
|
||||
m_Type = (PassType)reader.ReadInt32();
|
||||
@@ -840,32 +840,32 @@ namespace AssetStudio
|
||||
|
||||
public class SerializedTagMap
|
||||
{
|
||||
public KeyValuePair<string, string>[] tags;
|
||||
public List<KeyValuePair<string, string>> tags;
|
||||
|
||||
public SerializedTagMap(EndianBinaryReader reader)
|
||||
{
|
||||
int numTags = reader.ReadInt32();
|
||||
tags = new KeyValuePair<string, string>[numTags];
|
||||
tags = new List<KeyValuePair<string, string>>();
|
||||
for (int i = 0; i < numTags; i++)
|
||||
{
|
||||
tags[i] = new KeyValuePair<string, string>(reader.ReadAlignedString(), reader.ReadAlignedString());
|
||||
tags.Add(new KeyValuePair<string, string>(reader.ReadAlignedString(), reader.ReadAlignedString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class SerializedSubShader
|
||||
{
|
||||
public SerializedPass[] m_Passes;
|
||||
public List<SerializedPass> m_Passes;
|
||||
public SerializedTagMap m_Tags;
|
||||
public int m_LOD;
|
||||
|
||||
public SerializedSubShader(ObjectReader reader)
|
||||
{
|
||||
int numPasses = reader.ReadInt32();
|
||||
m_Passes = new SerializedPass[numPasses];
|
||||
m_Passes = new List<SerializedPass>();
|
||||
for (int i = 0; i < numPasses; i++)
|
||||
{
|
||||
m_Passes[i] = new SerializedPass(reader);
|
||||
m_Passes.Add(new SerializedPass(reader));
|
||||
}
|
||||
|
||||
m_Tags = new SerializedTagMap(reader);
|
||||
@@ -900,14 +900,14 @@ namespace AssetStudio
|
||||
public class SerializedShader
|
||||
{
|
||||
public SerializedProperties m_PropInfo;
|
||||
public SerializedSubShader[] m_SubShaders;
|
||||
public List<SerializedSubShader> m_SubShaders;
|
||||
public string[] m_KeywordNames;
|
||||
public byte[] m_KeywordFlags;
|
||||
public string m_Name;
|
||||
public string m_CustomEditorName;
|
||||
public string m_FallbackName;
|
||||
public SerializedShaderDependency[] m_Dependencies;
|
||||
public SerializedCustomEditorForRenderPipeline[] m_CustomEditorForRenderPipelines;
|
||||
public List<SerializedShaderDependency> m_Dependencies;
|
||||
public List<SerializedCustomEditorForRenderPipeline> m_CustomEditorForRenderPipelines;
|
||||
public bool m_DisableNoSubshadersMessage;
|
||||
|
||||
public SerializedShader(ObjectReader reader)
|
||||
@@ -917,10 +917,10 @@ namespace AssetStudio
|
||||
m_PropInfo = new SerializedProperties(reader);
|
||||
|
||||
int numSubShaders = reader.ReadInt32();
|
||||
m_SubShaders = new SerializedSubShader[numSubShaders];
|
||||
m_SubShaders = new List<SerializedSubShader>();
|
||||
for (int i = 0; i < numSubShaders; i++)
|
||||
{
|
||||
m_SubShaders[i] = new SerializedSubShader(reader);
|
||||
m_SubShaders.Add(new SerializedSubShader(reader));
|
||||
}
|
||||
|
||||
if (version[0] > 2021 || (version[0] == 2021 && version[1] >= 2)) //2021.2 and up
|
||||
@@ -935,19 +935,19 @@ namespace AssetStudio
|
||||
m_FallbackName = reader.ReadAlignedString();
|
||||
|
||||
int numDependencies = reader.ReadInt32();
|
||||
m_Dependencies = new SerializedShaderDependency[numDependencies];
|
||||
m_Dependencies = new List<SerializedShaderDependency>();
|
||||
for (int i = 0; i < numDependencies; i++)
|
||||
{
|
||||
m_Dependencies[i] = new SerializedShaderDependency(reader);
|
||||
m_Dependencies.Add(new SerializedShaderDependency(reader));
|
||||
}
|
||||
|
||||
if (version[0] >= 2021) //2021.1 and up
|
||||
{
|
||||
int m_CustomEditorForRenderPipelinesSize = reader.ReadInt32();
|
||||
m_CustomEditorForRenderPipelines = new SerializedCustomEditorForRenderPipeline[m_CustomEditorForRenderPipelinesSize];
|
||||
m_CustomEditorForRenderPipelines = new List<SerializedCustomEditorForRenderPipeline>();
|
||||
for (int i = 0; i < m_CustomEditorForRenderPipelinesSize; i++)
|
||||
{
|
||||
m_CustomEditorForRenderPipelines[i] = new SerializedCustomEditorForRenderPipeline(reader);
|
||||
m_CustomEditorForRenderPipelines.Add(new SerializedCustomEditorForRenderPipeline(reader));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,13 +8,12 @@ namespace AssetStudio
|
||||
public sealed class SkinnedMeshRenderer : Renderer
|
||||
{
|
||||
public PPtr<Mesh> m_Mesh;
|
||||
public PPtr<Transform>[] m_Bones;
|
||||
public List<PPtr<Transform>> m_Bones;
|
||||
public float[] m_BlendShapeWeights;
|
||||
public PPtr<Transform> m_RootBone;
|
||||
public AABB m_AABB;
|
||||
public bool m_DirtyAABB;
|
||||
|
||||
|
||||
public SkinnedMeshRenderer(ObjectReader reader) : base(reader)
|
||||
{
|
||||
int m_Quality = reader.ReadInt32();
|
||||
@@ -29,10 +28,11 @@ namespace AssetStudio
|
||||
|
||||
m_Mesh = new PPtr<Mesh>(reader);
|
||||
|
||||
m_Bones = new PPtr<Transform>[reader.ReadInt32()];
|
||||
for (int b = 0; b < m_Bones.Length; b++)
|
||||
var numBones = reader.ReadInt32();
|
||||
m_Bones = new List<PPtr<Transform>>();
|
||||
for (int b = 0; b < numBones; b++)
|
||||
{
|
||||
m_Bones[b] = new PPtr<Transform>(reader);
|
||||
m_Bones.Add(new PPtr<Transform>(reader));
|
||||
}
|
||||
|
||||
if (version[0] > 4 || (version[0] == 4 && version[1] >= 3)) //4.3 and up
|
||||
|
||||
@@ -79,14 +79,14 @@ namespace AssetStudio
|
||||
{
|
||||
public PPtr<Texture2D> texture;
|
||||
public PPtr<Texture2D> alphaTexture;
|
||||
public SecondarySpriteTexture[] secondaryTextures;
|
||||
public SubMesh[] m_SubMeshes;
|
||||
public List<SecondarySpriteTexture> secondaryTextures;
|
||||
public List<SubMesh> m_SubMeshes;
|
||||
public byte[] m_IndexBuffer;
|
||||
public VertexData m_VertexData;
|
||||
public SpriteVertex[] vertices;
|
||||
public List<SpriteVertex> vertices;
|
||||
public ushort[] indices;
|
||||
public Matrix4x4[] m_Bindpose;
|
||||
public BoneWeights4[] m_SourceSkin;
|
||||
public List<BoneWeights4> m_SourceSkin;
|
||||
public Rectf textureRect;
|
||||
public Vector2 textureRectOffset;
|
||||
public Vector2 atlasRectOffset;
|
||||
@@ -107,20 +107,20 @@ namespace AssetStudio
|
||||
if (version[0] >= 2019) //2019 and up
|
||||
{
|
||||
var secondaryTexturesSize = reader.ReadInt32();
|
||||
secondaryTextures = new SecondarySpriteTexture[secondaryTexturesSize];
|
||||
secondaryTextures = new List<SecondarySpriteTexture>();
|
||||
for (int i = 0; i < secondaryTexturesSize; i++)
|
||||
{
|
||||
secondaryTextures[i] = new SecondarySpriteTexture(reader);
|
||||
secondaryTextures.Add(new SecondarySpriteTexture(reader));
|
||||
}
|
||||
}
|
||||
|
||||
if (version[0] > 5 || (version[0] == 5 && version[1] >= 6)) //5.6 and up
|
||||
{
|
||||
var m_SubMeshesSize = reader.ReadInt32();
|
||||
m_SubMeshes = new SubMesh[m_SubMeshesSize];
|
||||
m_SubMeshes = new List<SubMesh>();
|
||||
for (int i = 0; i < m_SubMeshesSize; i++)
|
||||
{
|
||||
m_SubMeshes[i] = new SubMesh(reader);
|
||||
m_SubMeshes.Add(new SubMesh(reader));
|
||||
}
|
||||
|
||||
m_IndexBuffer = reader.ReadUInt8Array();
|
||||
@@ -131,10 +131,10 @@ namespace AssetStudio
|
||||
else
|
||||
{
|
||||
var verticesSize = reader.ReadInt32();
|
||||
vertices = new SpriteVertex[verticesSize];
|
||||
vertices = new List<SpriteVertex>();
|
||||
for (int i = 0; i < verticesSize; i++)
|
||||
{
|
||||
vertices[i] = new SpriteVertex(reader);
|
||||
vertices.Add(new SpriteVertex(reader));
|
||||
}
|
||||
|
||||
indices = reader.ReadUInt16Array();
|
||||
@@ -204,7 +204,7 @@ namespace AssetStudio
|
||||
public string[] m_AtlasTags;
|
||||
public PPtr<SpriteAtlas> m_SpriteAtlas;
|
||||
public SpriteRenderData m_RD;
|
||||
public Vector2[][] m_PhysicsShape;
|
||||
public List<Vector2[]> m_PhysicsShape;
|
||||
|
||||
public Sprite(ObjectReader reader) : base(reader)
|
||||
{
|
||||
@@ -247,10 +247,10 @@ namespace AssetStudio
|
||||
if (version[0] >= 2017) //2017 and up
|
||||
{
|
||||
var m_PhysicsShapeSize = reader.ReadInt32();
|
||||
m_PhysicsShape = new Vector2[m_PhysicsShapeSize][];
|
||||
m_PhysicsShape = new List<Vector2[]>();
|
||||
for (int i = 0; i < m_PhysicsShapeSize; i++)
|
||||
{
|
||||
m_PhysicsShape[i] = reader.ReadVector2Array();
|
||||
m_PhysicsShape.Add(reader.ReadVector2Array());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace AssetStudio
|
||||
public Vector4 uvTransform;
|
||||
public float downscaleMultiplier;
|
||||
public SpriteSettings settingsRaw;
|
||||
public SecondarySpriteTexture[] secondaryTextures;
|
||||
public List<SecondarySpriteTexture> secondaryTextures;
|
||||
|
||||
public SpriteAtlasData(ObjectReader reader)
|
||||
{
|
||||
@@ -32,10 +32,10 @@ namespace AssetStudio
|
||||
if (version[0] > 2020 || (version[0] == 2020 && version[1] >= 2)) //2020.2 and up
|
||||
{
|
||||
var secondaryTexturesSize = reader.ReadInt32();
|
||||
secondaryTextures = new SecondarySpriteTexture[secondaryTexturesSize];
|
||||
secondaryTextures = new List<SecondarySpriteTexture>();
|
||||
for (int i = 0; i < secondaryTexturesSize; i++)
|
||||
{
|
||||
secondaryTextures[i] = new SecondarySpriteTexture(reader);
|
||||
secondaryTextures.Add(new SecondarySpriteTexture(reader));
|
||||
}
|
||||
reader.AlignStream();
|
||||
}
|
||||
@@ -44,23 +44,23 @@ namespace AssetStudio
|
||||
|
||||
public sealed class SpriteAtlas : NamedObject
|
||||
{
|
||||
public PPtr<Sprite>[] m_PackedSprites;
|
||||
public List<PPtr<Sprite>> m_PackedSprites;
|
||||
public Dictionary<KeyValuePair<Guid, long>, SpriteAtlasData> m_RenderDataMap;
|
||||
public bool m_IsVariant;
|
||||
|
||||
public SpriteAtlas(ObjectReader reader) : base(reader)
|
||||
{
|
||||
var m_PackedSpritesSize = reader.ReadInt32();
|
||||
m_PackedSprites = new PPtr<Sprite>[m_PackedSpritesSize];
|
||||
m_PackedSprites = new List<PPtr<Sprite>>();
|
||||
for (int i = 0; i < m_PackedSpritesSize; i++)
|
||||
{
|
||||
m_PackedSprites[i] = new PPtr<Sprite>(reader);
|
||||
m_PackedSprites.Add(new PPtr<Sprite>(reader));
|
||||
}
|
||||
|
||||
var m_PackedSpriteNamesToIndex = reader.ReadStringArray();
|
||||
|
||||
var m_RenderDataMapSize = reader.ReadInt32();
|
||||
m_RenderDataMap = new Dictionary<KeyValuePair<Guid, long>, SpriteAtlasData>(m_RenderDataMapSize);
|
||||
m_RenderDataMap = new Dictionary<KeyValuePair<Guid, long>, SpriteAtlasData>();
|
||||
for (int i = 0; i < m_RenderDataMapSize; i++)
|
||||
{
|
||||
var first = new Guid(reader.ReadBytes(16));
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace AssetStudio
|
||||
public Quaternion m_LocalRotation;
|
||||
public Vector3 m_LocalPosition;
|
||||
public Vector3 m_LocalScale;
|
||||
public PPtr<Transform>[] m_Children;
|
||||
public List<PPtr<Transform>> m_Children;
|
||||
public PPtr<Transform> m_Father;
|
||||
|
||||
public Transform(ObjectReader reader) : base(reader)
|
||||
@@ -20,10 +20,10 @@ namespace AssetStudio
|
||||
m_LocalScale = reader.ReadVector3();
|
||||
|
||||
int m_ChildrenCount = reader.ReadInt32();
|
||||
m_Children = new PPtr<Transform>[m_ChildrenCount];
|
||||
m_Children = new List<PPtr<Transform>>();
|
||||
for (int i = 0; i < m_ChildrenCount; i++)
|
||||
{
|
||||
m_Children[i] = new PPtr<Transform>(reader);
|
||||
m_Children.Add(new PPtr<Transform>(reader));
|
||||
}
|
||||
m_Father = new PPtr<Transform>(reader);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
@@ -44,10 +45,10 @@ namespace AssetStudio
|
||||
if (version[0] >= 2020) //2020.1 and up
|
||||
{
|
||||
var m_VideoShadersSize = reader.ReadInt32();
|
||||
var m_VideoShaders = new PPtr<Shader>[m_VideoShadersSize];
|
||||
var m_VideoShaders = new List<PPtr<Shader>>();
|
||||
for (int i = 0; i < m_VideoShadersSize; i++)
|
||||
{
|
||||
m_VideoShaders[i] = new PPtr<Shader>(reader);
|
||||
m_VideoShaders.Add(new PPtr<Shader>(reader));
|
||||
}
|
||||
}
|
||||
m_ExternalResources = new StreamedResource(reader);
|
||||
|
||||
Reference in New Issue
Block a user