void Start() { // Selection.activeGameObject = GameObject.Find("sim_model"); // DestroyImmediate(Selection.activeGameObject); // Debug.Log("RUN HERE!"); // Material material = Resources.Load("Custom_NewSurfaceShader", typeof(Material)) as Material; // mesh = gameObject.AddComponent<MeshFilter>().mesh; // MeshRenderer meshRenderer = gameObject.AddComponent<MeshRenderer>(); // meshRenderer.material = material; Debug.Log("HERE"); mesh = GetComponent <MeshFilter>().mesh; Verts = mesh.vertices; Debug.Log(Verts); TestLoad testload = new TestLoad(); // Debug.Log(testload.dataMats.U[127, 11]); // Debug.Log(testload.modelMats.fc9_bias[3]); dataMats = testload.dataMats; modelMats = testload.modelMats; dataMatsEigen = testload.dataMatsEigen; modelMatsEigen = testload.modelMatsEigen; // Forward(); test(); }
// Start is called before the first frame update void Start() { TestLoad testload = new TestLoad(); dataMats = testload.dataMats; modelMats = testload.modelMats; dataMatsEigen = testload.dataMatsEigen; modelMatsEigen = testload.modelMatsEigen; Forward(); test(); }
public TestLoad() { // data_json_path = "D:/project/Unity Project/FlagSim/Assets/Datas/data_json.json"; // model_json_path = "D:/project/Unity Project/FlagSim/Assets/Datas/model_json.json"; TextAsset dataAsset = Resources.Load <TextAsset>("data_json"); dataMats = JsonConvert.DeserializeObject <DataMats>(dataAsset.text); TextAsset modelAsset = Resources.Load <TextAsset>("model_json"); modelMats = JsonConvert.DeserializeObject <ModelMats>(modelAsset.text); Debug.Log(dataMats); Debug.Log(modelMats); InitEigenMats(); SetEigenMatsValues(); // Debug.Log(dataMats.alpha[127]); // Debug.Log(dataMats.U[127, 11]); // Debug.Log(modelMats.fc9_bias[3]); }