示例#1
0
        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());
            }
        }
示例#2
0
 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");
             }
         }
     }
 }
示例#3
0
 public int Add(Life life)
 {
     Lives.Add(life);
     return(Lives.Count - 1);
 }