private void OnTriggerEnter(Collider other)
 {
     print(other.gameObject.layer);
     if (other.gameObject.layer == LayerMask.NameToLayer("Character"))
     {
         audioManager.Play("BGMCollectCoin");
         manager.AddMoney(1);
         Destroy(gameObject, 0.1f);
     }
 }
Exemple #2
0
    public void AddNewCurrency()
    {
        int addedAmount = (int.Parse(timer.getSeconds()) + (int.Parse(timer.getMinutes()) * 60)) / 2;

        //int addedAmount = 10;
        currencyManager.AddMoney(addedAmount);

        //displat currency
        currencyText.text = "+" + addedAmount.ToString() + " coins";
    }
Exemple #3
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.
         currencyManager.AddMoney(20);
     }
     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.");
     }
 }