Exemple #1
0
        public void prepModel()
        {
            if (model != null)
            {
                return;
            }

            String    transformName = "ProcDecouplerRoot";
            Transform modelBase     = part.transform.FindRecursive(transformName);

            if (modelBase != null)
            {
                GameObject.DestroyImmediate(modelBase.gameObject);
            }
            modelBase = new GameObject(transformName).transform;
            modelBase.NestToParent(part.transform.FindRecursive("model"));
            model = new ProceduralCylinderModel();

            UVMap uvs = UVMap.GetUVMapGlobal(uvMap);

            model.outsideUV = uvs.getArea("outside");
            model.insideUV  = uvs.getArea("inside");
            model.topUV     = uvs.getArea("top");
            model.bottomUV  = uvs.getArea("bottom");
            setModelParameters();
            model.setMaterial(fairingMaterial);
            model.createModel();
            model.setParent(modelBase);
            updatePhysicalAttributes();
            updateDecouplerForce();
            SSTUModInterop.onPartGeometryUpdate(part, true);
        }
 public override string GetInfo()
 {
     //destroy the model after the prefab part/icon part has been created
     model.destroyModel();
     model = null;
     return "This part has configurable diameter, height, thickness, and ejection force.";
 }
Exemple #3
0
 public override string GetInfo()
 {
     //destroy the model after the prefab part/icon part has been created
     model.destroyModel();
     model = null;
     return("This part has configurable diameter, height, thickness, and ejection force.");
 }
 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);
 }
 public override string GetInfo()
 {
     model.destroyModel();
     SSTUUtils.destroyChildren(part.FindModelTransform("model"));//remove the original empty proxy model and any created models
     model = null;
     return "This part has configurable diameter, height, thickness, and ejection force.";
 }
 //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();
 }
 //DONE
 public override string GetInfo()
 {
     model.destroyModel ();
     SSTUUtils.destroyChildren(part.FindModelTransform ("model"));//remove the original empty proxy model and any created models
     model = null;
     return base.GetInfo ();
 }
        public void prepModel()
        {
            if (model != null)
            {
                return;
            }

            String transformName = "ProcDecouplerRoot";
            Transform modelBase = part.transform.FindRecursive(transformName);
            if (modelBase != null)
            {
                GameObject.DestroyImmediate(modelBase.gameObject);
            }
            modelBase = new GameObject(transformName).transform;
            modelBase.NestToParent(part.transform.FindRecursive("model"));
            model = new ProceduralCylinderModel();

            UVMap uvs = UVMap.GetUVMapGlobal(uvMap);
            model.outsideUV = uvs.getArea("outside");
            model.insideUV = uvs.getArea("inside");
            model.topUV = uvs.getArea("top");
            model.bottomUV = uvs.getArea("top");
            setModelParameters();
            TextureData data = currentTextureSetData.textureDatas[0];
            model.setMaterial(SSTUUtils.loadMaterial(data.diffuseTextureName, data.normalTextureName));
            model.createModel();
            model.setParent(modelBase);
            updatePhysicalAttributes();
            updateDecouplerForce();
            SSTUModInterop.onPartGeometryUpdate(part, true);
        }