title: Function "OnApplicationPause" works when the application starts. Android, unity3d
body: <p>When I launch my game in game editor or on the phone - it glitches for the 2-3 seconds and  calls the function <code>OnApplicationPause</code>. But when I close application/pause in editor it doesn't calls. That's bad for my project so how to fix it? There's function code :</p>
  
  <pre><code>void OnApplicationPause()
  {
      DateTime time = DateTime.Now;
      SaveVariablesInClass();
      PlayerPrefs.SetString("SV", JsonUtility.ToJson(save)); //saves special class
  }
  
  void SaveVariablesInClass()
  {
      save.Bananas = bananas;
      save.GoldBananas = goldBananas;
  
      save.TwoBananasSpawnChance = twoBananasSpawnChance;
      save.HigherBananaLevelChance = higherBananaLevelChance;
      save.SimpleBananaStormChance = simpleBananaStormChance;
  
      save.GoldBananaChance = goldBananaChance;
      save.TwoGoldBananaChance = twoGoldBananaChance;
  
      save.offlineEfficiency = offlineEfficiency;
      save.offlineProductionTime = offlineProductionTime;
  
      save.goldCoefficient = goldCoefficient;
  
      save.BonusLevels = bonusLevels;
      save.GoldBonusLevels = goldBonusLevels;
      save.SimpleBonusLevelPrices = simpleBonusLevelPrices;
      save.GoldBonusLevelPrices = goldBonusLevelPrices;
      save.simpleMaxLevels = simpleMaxLevels;
      save.goldMaxLevels = goldMaxLevels;
  
      save.time = time.ToString();
  
      save.CurrentSimpleBonus1 = currentSimpleBonus1;
      save.LaunchedGame = launchedGame;
  }
  </code></pre>