using UnityEngine;
using System.Collections;
using VascoGames;
public class ReceiveMemoryWarningHandler : Singleton<ReceiveMemoryWarningHandler> {
#if UNITY_IOS
public void OnReceivedMemoryWarning(string msg){
Debug.Log("Memory warning received from iOS");
Resources.UnloadUnusedAssets();
}
#endif
}
In my scene I have a GameObject named “MemoryHandlerIOS”. According to the manual the first parameter in UnitySendMessage should be name of the game object.
printf_console doesn’t output the message in the mm file and the Debug.Log from the class isn’t called either. However I’m not entirely sure if that’s due to the fact I have Debug Scripting off ( can’t compile if I turn that on ).
Remove line 7 from your .mm and make sure your GameObject and unity C# class names are both MemoryHandlerIOS. If that doesn’t work, try changing your derived class to MonoBehaviour instead of the Singleton.
Originally line 7 wasn’t there either, but that didn’t work.
Singleton is derived from monoheviour. If I change the unity AppController.mm in xcode directly all calls are made fine.
It just seems like my custom mm controller doesn’t have any effect.
Hey @SimteractiveDev I pretty much dropped it. But I do remember a few of those debug lines popping up but not sure how or what I did. I moved on from that project. Sorry.