バックグラウンドでの処理
- 非Active時にUnityの動作を続けるように設定する
を選択し、Run In Backgroundにチェックを入れる

バックグラウンドへの移行と復帰を検知する
OnApplicationPause(bool pause)を使い、引数pauseStatusでバックグラウンドへの移行とフォアグラウンドへの復帰を判別します。
hoge.cs
void OnApplicationPause (bool pauseStatus)
{
if (pauseStatus) {
Debug.Log("applicationWillResignActive or onPause");
} else {
Debug.Log("applicationDidBecomeActive or onResume");
}
}