Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tsubaki
Last active December 21, 2015 04:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsubaki/6249121 to your computer and use it in GitHub Desktop.
Save tsubaki/6249121 to your computer and use it in GitHub Desktop.
メモリワーニングになったらGameControllerオブジェクトのvoid MemoryWarning(string msg)へ通知してくれるプラグイン。
//
// MemoryWarning.mm
//
// Created by tsubaki on 2013/08/16.
//
//
#import "iPhone_target_Prefix.pch"
#import "UnityAppController.h"
@interface MemoryWarning : UnityAppController
+(void)load;
@end
@implementation MemoryWarning
+(void)load
{
extern const char* AppControllerClassName;
AppControllerClassName = "MemoryWarning";
}
- (void)applicationDidReceiveMemoryWarning:(UIApplication*)application
{
[super applicationDidReceiveMemoryWarning:application];
UnitySendMessage("GameController", "MemoryWarning", "user=san, tsukaisugi!!!ba-ka!!!");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment