public void LoadFrom(Stream stream, uint version) { BinaryReader reader = new BinaryReader(stream); int numStates = reader.ReadInt32(); m_StateConstantArray = new List <StateConstant>(numStates); for (int i = 0; i < numStates; i++) { m_StateConstantArray.Add(new StateConstant(stream, version)); } int numAnyStates = reader.ReadInt32(); m_AnyStateTransitionConstantArray = new TransitionConstant[numAnyStates]; for (int i = 0; i < numAnyStates; i++) { m_AnyStateTransitionConstantArray[i] = new TransitionConstant(stream, version); } if (version >= AssetCabinet.VERSION_5_0_0) { int numSelectors = reader.ReadInt32(); m_SelectorStateConstantArray = new SelectorStateConstant[numSelectors]; for (int i = 0; i < numSelectors; i++) { m_SelectorStateConstantArray[i] = new SelectorStateConstant(stream); } } m_DefaultState = reader.ReadUInt32(); m_MotionSetCount = reader.ReadUInt32(); }
public void LoadFrom(Stream stream) { BinaryReader reader = new BinaryReader(stream); int numTransistions = reader.ReadInt32(); m_TransitionConstantArray = new TransitionConstant[numTransistions]; for (int i = 0; i < numTransistions; i++) { m_TransitionConstantArray[i] = new TransitionConstant(stream); } int numBlendIndices = reader.ReadInt32(); m_BlendTreeConstantIndexArray = new int[numBlendIndices]; for (int i = 0; i < numBlendIndices; i++) { m_BlendTreeConstantIndexArray[i] = reader.ReadInt32(); } int numInfos = reader.ReadInt32(); m_LeafInfoArray = new LeafInfoConstant[numInfos]; for (int i = 0; i < numInfos; i++) { m_LeafInfoArray[i] = new LeafInfoConstant(stream); } int numBlends = reader.ReadInt32(); m_BlendTreeConstantArray = new BlendTreeConstant[numBlends]; for (int i = 0; i < numBlends; i++) { m_BlendTreeConstantArray[i] = new BlendTreeConstant(stream); } m_NameID = reader.ReadUInt32(); m_PathID = reader.ReadUInt32(); m_TagID = reader.ReadUInt32(); m_Speed = reader.ReadSingle(); m_CycleOffset = reader.ReadSingle(); m_IKOnFeet = reader.ReadBoolean(); m_Loop = reader.ReadBoolean(); m_Mirror = reader.ReadBoolean(); reader.ReadByte(); }
public void LoadFrom(Stream stream) { BinaryReader reader = new BinaryReader(stream); int numStates = reader.ReadInt32(); m_StateConstantArray = new StateConstant[numStates]; for (int i = 0; i < numStates; i++) { m_StateConstantArray[i] = new StateConstant(stream); } int numAnyStates = reader.ReadInt32(); m_AnyStateTransitionConstantArray = new TransitionConstant[numAnyStates]; for (int i = 0; i < numAnyStates; i++) { m_AnyStateTransitionConstantArray[i] = new TransitionConstant(stream); } m_DefaultState = reader.ReadUInt32(); m_MotionSetCount = reader.ReadUInt32(); }
public void LoadFrom(Stream stream, uint version) { BinaryReader reader = new BinaryReader(stream); int numTransistions = reader.ReadInt32(); m_TransitionConstantArray = new TransitionConstant[numTransistions]; for (int i = 0; i < numTransistions; i++) { m_TransitionConstantArray[i] = new TransitionConstant(stream, version); } int numBlendIndices = reader.ReadInt32(); m_BlendTreeConstantIndexArray = new int[numBlendIndices]; for (int i = 0; i < numBlendIndices; i++) { m_BlendTreeConstantIndexArray[i] = reader.ReadInt32(); } if (version < AssetCabinet.VERSION_5_0_0) { int numInfos = reader.ReadInt32(); m_LeafInfoArray = new LeafInfoConstant[numInfos]; for (int i = 0; i < numInfos; i++) { m_LeafInfoArray[i] = new LeafInfoConstant(stream); } } int numBlends = reader.ReadInt32(); m_BlendTreeConstantArray = new BlendTreeConstant[numBlends]; for (int i = 0; i < numBlends; i++) { m_BlendTreeConstantArray[i] = new BlendTreeConstant(stream, version); } m_NameID = reader.ReadUInt32(); m_PathID = reader.ReadUInt32(); if (version >= AssetCabinet.VERSION_5_0_0) { m_FullPathID = reader.ReadUInt32(); } m_TagID = reader.ReadUInt32(); if (version >= AssetCabinet.VERSION_5_0_0) { m_SpeedParamID = reader.ReadUInt32(); m_MirrorParamID = reader.ReadUInt32(); m_CycleOffsetParamID = reader.ReadUInt32(); } m_Speed = reader.ReadSingle(); m_CycleOffset = reader.ReadSingle(); m_IKOnFeet = reader.ReadBoolean(); if (version >= AssetCabinet.VERSION_5_0_0) { m_WriteDefaultValues = reader.ReadBoolean(); } m_Loop = reader.ReadBoolean(); m_Mirror = reader.ReadBoolean(); if (version < AssetCabinet.VERSION_5_0_0) { stream.Position++; } }