public void prepModel() { if (model != null) { return; } Transform tr = part.transform.FindRecursive("model"); SSTUUtils.destroyChildren(tr);//remove the original empty proxy model, and any models that may have been attached during prefab init model = new ProceduralCylinderModel(); model.outsideUV = outsideUV; model.insideUV = insideUV; model.topUV = topUV; model.bottomUV = bottomUV; updateModelParameters(); setModelParameters(); model.setMaterial(SSTUUtils.loadMaterial(diffuseTextureName, normalTextureName)); model.setMeshColliderStatus(true, false); model.createModel(); model.setParent(tr); updatePhysicalAttributes(); updateDecouplerForce(); updateDragCube(); SSTUUtils.updatePartHighlighting(part); SSTUModInterop.onPartGeometryUpdate(part, true); }
//DONE public void prepModel() { if (model != null) { return; } Transform tr = part.FindModelTransform("model"); SSTUUtils.destroyChildren(tr);//remove the original empty proxy model model = new ProceduralCylinderModel (); updateModelParameters (); setModelParameters (); model.setMaterial (SSTUUtils.loadMaterial (diffuseTextureName, normalTextureName)); model.setMeshColliderStatus (true, false); model.createModel (); model.setParent(tr); updatePhysicalAttributes (); updateDecouplerForce (); updateDragCube (); resetHighlighter(); }