public AnimatorController(AssetPreloadData preloadData) { var sourceFile = preloadData.sourceFile; var version = preloadData.sourceFile.version; var reader = preloadData.InitReader(); reader.Position = preloadData.Offset; m_Name = reader.ReadAlignedString(); var m_ControllerSize = reader.ReadUInt32(); var m_Controller = new ControllerConstant(reader, version); int tosSize = reader.ReadInt32(); var m_TOS = new List <KeyValuePair <uint, string> >(tosSize); for (int i = 0; i < tosSize; i++) { m_TOS.Add(new KeyValuePair <uint, string>(reader.ReadUInt32(), reader.ReadAlignedString())); } int numClips = reader.ReadInt32(); m_AnimationClips = new PPtr[numClips]; for (int i = 0; i < numClips; i++) { m_AnimationClips[i] = sourceFile.ReadPPtr(); } }
public AnimatorController(ObjectReader reader) : base(reader) { var m_ControllerSize = reader.ReadUInt32(); var m_Controller = new ControllerConstant(reader); int tosSize = reader.ReadInt32(); var m_TOS = new KeyValuePair <uint, string> [tosSize]; for (int i = 0; i < tosSize; i++) { m_TOS[i] = new KeyValuePair <uint, string>(reader.ReadUInt32(), reader.ReadAlignedString()); } int numClips = reader.ReadInt32(); m_AnimationClips = new PPtr <AnimationClip> [numClips]; for (int i = 0; i < numClips; i++) { m_AnimationClips[i] = new PPtr <AnimationClip>(reader); } }