12345678910111213141516171819202122232425262728293031323334353637383940 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class LoadModelData : MonoBehaviour
- {
- public List<Vector3> a;
- public List<int> b;
- public Mesh mesh;
- // Start is called before the first frame update
- void Start()
- {
- mesh = this.gameObject.GetComponent<MeshFilter>().mesh;
- Debug.LogError(mesh.vertices.Length);
- a = new List<Vector3>(mesh.vertices);
- string infoString = string.Empty;
- for (int i = 0; i < 1000; i++)
- {
- infoString += mesh.vertices[i].x +","+ mesh.vertices[i].y + ","+mesh.vertices[i].z +":";
- }
- Debug.LogError(infoString);
- infoString = string.Empty;
- Debug.LogError(mesh.uv.Length);
- for (int i = 0; i < 1000; i++)
- {
- infoString += mesh.uv[i].x +","+ mesh.uv[i].y+":";
- }
- Debug.LogError(infoString);
- infoString = string.Empty;
- Debug.LogError(mesh.triangles.Length);
- for (int i = 0; i < 1000; i++)
- {
- infoString += mesh.triangles[i] + ":";
- }
- b = new List<int>(mesh.triangles);
- Debug.LogError(infoString);
- }
- }
|