Ejemplo n.º 1
0
    void Update()
    {
        // Spin the cube. Proves that the batch is reading the matrices just fine
        var transforms = _brg.GetBatchMatrices(_batch);

        transforms[0] = Matrix4x4.Rotate(Quaternion.Euler(Mathf.Sin(Time.time) * 180, Mathf.Sin(Time.time) * 180, Mathf.Cos(Time.time) * 180));

        // I thought this would set the color in the shader but it isn't working for me
        var instVals = _brg.GetBatchVectorArray(_batch, "_Color");

        instVals[0] = new Vector4(0, 1, 0, 1);
    }