サスペンド/レジューム
FCoreDelegatesクラスにプラットフォーム毎のOSやファームウェアからのイベント関連が纏まっている。のでメモがてら抜粋。
実際の動作はどうもプラットフォームごとにまちまちで、ソースを読まないと分からない(辛い)。
/** IOS-style application lifecycle delegates */
DECLARE_MULTICAST_DELEGATE(FApplicationLifetimeDelegate);
CoreDelegates.h
// This is called when the application is about to be deactivated (e.g., due to a phone call or SMS or the sleep button).
// The game should be paused if possible, etc...
これは、アプリケーションが非アクティブ化されようとしているときに呼び出されます(たとえば、電話、SMS、またはスリープボタンが原因で)。
可能であれば、ゲームを一時停止する必要があります。
FCoreDelegates::ApplicationWillDeactivateDelegate;
// Called when the application has been reactivated (reverse any processing done in the Deactivate delegate)
アプリケーションが再アクティブ化されたときに呼び出されます(Deactivateデリゲートで行われた処理を元に戻します)
FCoreDelegates::ApplicationHasReactivatedDelegate;
// This is called when the application is being backgrounded (e.g., due to switching
// to another app or closing it via the home button)
// The game should release shared resources, save state, etc..., since it can be
// terminated from the background state without any further warning.
// for instance, hitting the home button
これは、アプリケーションがバックグラウンドで実行されているときに呼び出されます(たとえば、別のアプリケーションに切り替えたり、ホームボタンでアプリケーションを閉じたりしたため)。ゲームはバックグラウンド状態から終了できるため、共有リソースを解放したり、状態を保存したりする必要があります。 それ以上の警告なし。
例)ホームボタンを押す
FCoreDelegates::ApplicationWillEnterBackgroundDelegate;
// Called when the application is returning to the foreground (reverse any processing done in the EnterBackground delegate)
アプリケーションがフォアグラウンドに戻るときに呼び出されます(EnterBackgroundデリゲートで行われたすべての処理を逆にします)
FCoreDelegates::ApplicationHasEnteredForegroundDelegate;
// This *may* be called when the application is getting terminated by the OS.
// There is no guarantee that this will ever be called on a mobile device,
// save state when ApplicationWillEnterBackgroundDelegate is called instead.
これは、アプリケーションがOSによって終了されるときに呼び出される可能性があります。
これがモバイルデバイスで呼び出されるという保証はありません。
代わりにApplicationWillEnterBackgroundDelegateが呼び出されたときに状態を保存します。
FCoreDelegates::ApplicationWillTerminateDelegate;