
Untitled
By: a guest on
Aug 12th, 2012 | syntax:
C# | size: 0.63 KB | hits: 15 | expires: Never
public class MemoryTest : EditorWindow
{
[MenuItem("Window/MemoryTest")]
public static void Init()
{
GetWindow<MemoryTest>();
}
private static List<float[,]> Data = new List<float[,]>();
public void OnGUI()
{
if(GUILayout.Button("Add"))
Data.Add(RandomValues());
if (GUILayout.Button("Clear"))
Data.Clear();
}
private float[,] RandomValues()
{
var f = new float[5096,5096];
for(var y = 0; y<512; y++)
for (var x = 0; x < 512; x++)
f[y,x] = Random.Range(0, 1f);
return f;
}
}