2014-03-25 3 views

답변

0

안드로이드에서 필자가 아는 한 내장 기능이 없습니다.

+0

나는 분명히 말하자면, Unity와 관련이 없다는 것을 의미합니다. Android에는 메모리 경고 개념이 없습니다. 그게 맞습니까? 고마워요. – Fattie

+0

잠깐 - onTrimMemory와 onLowMemory는 어떨까요? 예 : http://stackoverflow.com/questions/14767766/android-counterpart-of-ios-memory-warning – Fattie

+0

이러한 메서드는 OOM 예외보다 먼저 호출되지 않습니다. 전체 시스템의 메모리가 부족할 때 호출됩니다. – meredrica

0

당신은 게임 시작 일부 monoBehaviour에, 예를 들어 Application.lowMemoryDocumentation

에 가입 할 수 있습니다 :

private void Start() 
{ 
    Application.lowMemory += ReportSystemLowMemory; 
} 


private void ReportSystemLowMemory() 
{ 
    Debug.LogWarning("Warning: Low memory"); 
} 
  • 는 한 번 이상 ReportSystemLowMemory 이상을 가입하지 않은해야합니다.
  • 앱/게임을 닫을 때 앱을 구독 취소하는 것이 좋습니다 (예 : Application.lowMemory -= ReportSystemLowMemory).