Esempio n. 1
0
    // 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();
        }
    }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     shape           = FunctionsRepository.Shape.Custom;
     scale           = 0.1f;
     resolution      = 100;
     this.vertexMesh = new VertexMesh(this, shape, scale, resolution);
 }
Esempio n. 3
0
    // 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();
        }
    }
Esempio n. 4
0
 // Use this for initialization
 void Start()
 {
     SimplePool.Preload(pointPrefab, 100);
     shape      = FunctionsRepository.Shape.Cube;
     resolution = MIN_RESOLUTION;
     CreateCubes();
 }
Esempio n. 5
0
 public void UpdateMesh(FunctionsRepository.Shape shape, float scale, float sweet, float sour, float umami, float bitter, float salty)
 {
     this.shape = shape;
     this.scale = scale;
     repository.SetShape(shape);
     repository.SetTastes(sweet, sour, umami, bitter, salty);
     ReDoMesh();
 }
Esempio n. 6
0
 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();
 }
Esempio n. 7
0
    // Update is called once per frame
    void Update()
    {
        bool changed = false;

        if (_scale != scale)
        {
            changed = true;
            _scale  = scale;
        }

        if (shape != _shape)
        {
            Debug.Log("Shape changed to: " + shape);
            _shape  = shape;
            changed = true;
        }

        changed = changed || TastesChanged();

        if (changed && vertexMesh != null)
        {
            vertexMesh.UpdateMesh(shape, scale, sweet, sour, umami, bitter, salty);
        }
    }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     CreateParticles();
     currentShape = FunctionsRepository.Shape.Cube;
 }