static void Test() {
// Sets _matrices[_viewMatricesStartIndex + 3] to Matrix4x4.Identity
ref var viewMatrix = ref GetMatrix(MatrixType.ViewMatrix, 3);
viewMatrix = Matrix4x4.Identity;
// We can dereference the reference and copy its value to a local here by using the standard local variable declaration syntax
var projMatrix = GetMatrix(MatrixType.ProjectionMatrix, 2);
projMatrix.M11 = 3f; // Changes only the local 'projMatrix', does not affect anything in _matrices
}
Code snippet taken from "Complete C# Quick Reference - C# 7".