private void Start() { MainGrid = LoadLastSave ? GroundLoader.Load() : GroundLoader.Load(DefaultGridFile.text); InteractionMesh = new InteractionMesh(new Mesh()); UpdateInteractionGrid(); InteractionMeshObject.GetComponent <MeshFilter>().mesh = InteractionMesh.Mesh; BaseGridVisual.GetComponent <MeshFilter>().mesh = CloneInteractionMesh(); optionsSource = new OptionsByDesignation(VoxelBlueprints); visualsAssembler = new VoxelVisualsManager(VoxelDisplayMat, optionsSource); solver = new VisualsSolvingManager(MainGrid, optionsSource); }
public void UpdateInteractionGrid() { InteractionMesh.UpdateMesh(MainGrid); InteractionMeshObject.GetComponent <MeshCollider>().sharedMesh = null; // Hack to force update InteractionMeshObject.GetComponent <MeshCollider>().sharedMesh = InteractionMesh.Mesh; }