public VertexMesh(GraphController parent, FunctionsRepository.Shape shape, float scale, int resolution) { this.parent = parent; this.shape = shape; this.scale = scale; this.resolution = resolution; repository.SetShape(shape); repository.SetTastes(11, 11, 11, 11, 11); ReDoMesh(); }
// Update is called once per frame void Update() { system.SetParticles(particles, particles.Length); if (_currentShape != currentShape) { Debug.Log("Shape changed to: " + currentShape); _currentShape = currentShape; changed = true; repository.SetShape(currentShape); } if (_resolution != resolution) { if (resolution < MIN_RESOLUTION || resolution > MAX_RESOLUTION) { Debug.Log("Trying to set Resolution to wrong value! Resetting to minimum"); resolution = MIN_RESOLUTION; } Debug.Log("Resolution changed to: " + resolution); _resolution = resolution; changed = true; } if (changed) { changed = false; UpdateParticles(); } }
// Update is called once per frame void Update() { CreateCubes(); if (_scale != scale) { changed = true; _scale = scale; } if (shape != _shape) { Debug.Log("Shape changed to: " + shape); _shape = shape; changed = true; repository.SetShape(shape); } if (_resolution != resolution) { if (resolution < MIN_RESOLUTION || resolution > MAX_RESOLUTION) { Debug.Log("Trying to set Resolution to wrong value! Resetting to minimum"); resolution = MIN_RESOLUTION; } Debug.Log("Resolution changed to: " + resolution); _resolution = resolution; changed = true; } if (changed) { changed = false; UpdateParticles(); } }