private void OnLivesChanged(object sender, int lives) { if (lives < 0) { return; } while (Lives.Count > lives) { Lives.RemoveAt(0); } while (Lives.Count < lives) { Lives.Add(new object()); } }
public void OnUnityAdsDidFinish(string placementId, ShowResult showResult) { if (Keys.ID.PlacementReward == placementId) { if (showResult == ShowResult.Finished) { if (_isShop) { _coin.AddReward(); PlayerPrefs.SetInt(Keys.CountRewardAdvertising, PlayerPrefs.GetInt(Keys.CountRewardAdvertising) + 1); } else { var spawn = FindObjectOfType <SpawnCubes>(); spawn.GetCube(_cube, _mainCube); _lives.Add(); PlayerPrefs.SetString(Keys.ContinuedAdvertising, "True"); } } } }
public int Add(Life life) { Lives.Add(life); return(Lives.Count - 1); }