public static void SaveGameMatrix(Matrix matrix) { for(int y = 0; y < matrix.GetMatrixHeight();y++) { for(int x = 0; x < matrix.GetMatrixWidth();x++) { PlayerPrefs.SetInt(y.ToString()+x.ToString(),(int)matrix.GetValueByXY(x,y)); } } PlayerPrefs.SetInt("width",matrix.GetMatrixHeight()); PlayerPrefs.SetInt("height",matrix.GetMatrixWidth()); }