private void CheckGameWin()
 {
     if (td.CountDifferences() <= 0)
     {
         PlayerPrefs.SetInt("Room Completed", currentBuildIndex);
         td.LevelCompleted();
     }
 }
Esempio n. 2
0
 // Implement IUnityAdsListener interface methods:
 public void OnUnityAdsDidFinish(string placementId, ShowResult showResult)
 {
     // Define conditional logic for each ad completion status:
     if (showResult == ShowResult.Finished)
     {
         // Reward the user for watching the ad to completion.
         max   = td.CountDifferences();
         index = Random.Range(min, max);
         Transform hintTransform = td.GetDifferencePosition(index - 1);
         cameraControls.ResetZoom();
         GameObject obHinter = Instantiate(hinter, hintTransform.position, Quaternion.identity);
         Destroy(obHinter, 3.0f);
     }
     else if (showResult == ShowResult.Skipped)
     {
         // Do not reward the user for skipping the ad.
     }
     else if (showResult == ShowResult.Failed)
     {
         Debug.LogWarning("The ad did not finish due to an error.");
     }
 }