Esempio n. 1
0
 public void SetModel(SurfaceModel surfaceModel, MeshRenderer renderer)
 {
     if (IsInPreviewMode)
     {
         RestoreModelMaterial();
     }
     Model          = surfaceModel;
     Modelrenderer  = renderer;
     cachedMaterial = Modelrenderer.sharedMaterial;
     if (renderer.lightmapIndex >= 0)
     {
         ModelLightmapData = LightmapSettings.lightmaps[renderer.lightmapIndex];
     }
 }
        // Update is called once per frame
        void UpdateMeshData(MeshFilter filter)
        {
            HasMesh = false;

            if (SurfaceModel == null)
                SurfaceModel = new SurfaceModel();
            else
                SurfaceModel.Clear();

            update = false;

            SurfaceModel.SetMesh(selectedObject.transform, currentMeshFilter.sharedMesh);
            HasMesh = true;

            if (MeshProcessor == null)
                MeshProcessor = new SurfaceMeshProcessor();
            MeshProcessor.SetModel(SurfaceModel, currentMeshRenderer);
        }