private byte[] mem;
private long memSize = 0;
void Test(){
mem = null;
System.GC.Collect ();
memSize += 10 * 1024*1024;
mem = new byte[memSize];
}
void OnGUI(){
if (GUI.Button (new Rect (10, 10, 150, 100), "+10MB内存")) {
Test();
Debug.Log("OK");
}
}
增加mono内存的代码
最新推荐文章于 2022-01-09 11:16:54 发布