void LoadModel() { GCAssetReader.Model testModel = GCAssetReader.Reader.ReadFile(_testModelPath); ModLogger.LogInfo($"Loaded test model with {testModel.Vertices.Count} vertices and {testModel.Indices.Count} indices."); List <Vector3> vertices = new List <Vector3>(testModel.Vertices.Capacity); foreach (Vec3 v in testModel.Vertices) { vertices.Add(new Vector3(v.X, v.Y, v.Z)); } List <Vector3> normals = new List <Vector3>(testModel.Normals.Capacity); foreach (Vec3 normal in testModel.Normals) { normals.Add(new Vector3(normal.X, normal.Y, normal.Z)); } List <Vector2> uvs = new List <Vector2>(testModel.UVs.Capacity); foreach (Vec2 uv in testModel.UVs) { uvs.Add(new Vector2(uv.X, uv.Y)); } StartCoroutine(LoadTexture(testModel.Texture)); MeshFilter mf = _obj.GetComponent <MeshFilter>(); Mesh mesh = new Mesh(); mesh.vertices = vertices.ToArray(); mesh.normals = normals.ToArray(); mesh.SetIndices(testModel.Indices.ToArray(), MeshTopology.Triangles, 0); mesh.uv = uvs.ToArray(); mf.sharedMesh = mesh; }