Esempio n. 1
0
    /// <summary>
    /// Updates the Vector3 property for all bricks on the shader.
    /// </summary>
    /// <param name="propName"></param>
    /// <param name="val"></param>
    public void updateMaterialPropVector3All(string propName, Vector3 val)
    {
        // Update the volumeMaterial
        VolumeMaterial.SetVector(propName, val);

        // Update the materials in all of the bricks
        for (int i = 0; i < bricks.Length; i++)
        {
            Bricks[i].GameObject.GetComponent <Renderer>().material.SetVector(propName, val);
        }
    }
Esempio n. 2
0
    /// <summary>
    /// Updates the Texture3D property for all bricks on the shader.
    /// </summary>
    /// <param name="propName"></param>
    /// <param name="tex"></param>
    public void updateMaterialPropTexture3DAll(string propName, Texture3D tex)
    {
        // Update the volumeMaterial
        VolumeMaterial.SetTexture(propName, tex);

        // Update the materials in all of the bricks
        for (int i = 0; i < Bricks.Length; i++)
        {
            Bricks[i].GameObject.GetComponent <Renderer>().material.SetTexture(propName, tex);
        }
    }