Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Friction · Mar 19, 2015 at 05:07 PM · videoadmobadvertising

UnityAds Rewarded Video

Hello, I'm new in mobile game development. I want to add "Earn money" button in my game. I am using UnityAds services.

 if(GUI.Button(new Rect(10,10,200,50),"EARN!")){
 ........PLAY REWARDED VIDEO..........
 if(!skipped)
 money++;
 }


Can you write an example about UnityAdsVideoCompleted function? Thanks

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tigertrussell · Mar 19, 2015 at 06:21 PM 0
Share

Such a broad request (esp. one that contains "please write me code") should be posted to the forums.

avatar image Friction · Mar 19, 2015 at 10:42 PM 0
Share

Can someone help me?

1 Reply

· Add your reply
  • Sort: 
avatar image
6
Best Answer

Answer by fedecaccia · May 04, 2015 at 11:25 AM

You can use a rewarded zone, and a callback function to do it. Check you have "rewardedVideoZone " enabled in your dashboard. Here i give you an example of how you can implement your code:

     if(GUI.Button(new Rect(10,10,200,50),"EARN!")){
        ShowAd();
     }

 public void ShowAd(string zone = "rewardedVideoZone "){ 

     ShowOptions options = new ShowOptions();
     options.resultCallback = AdCallbackhanler;

     if (Advertisement.isReady(zone))
     {
         Advertisement.Show (zone,options);
     }
 }

 void AdCallbackhanler(ShowResult result){
     switch (result){
     case ShowResult.Finished:
         Debug.Log ("Ad Finished. Rewarding player...");
         money++;
         break;
     case ShowResult.Skipped:
         Debug.Log ("Ad Skipped");
     case ShowResult.Failed:
         Debug.Log("Ad failed");
         break;
     }
 }
Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cdm89 · May 03, 2016 at 08:55 PM 0
Share

Where can i find the zone? is this the "integration id" found in my dashboard? thanks

avatar image fedecaccia cdm89 · May 03, 2016 at 09:28 PM 0
Share

@cdm89 You can check the answer here: http://forum.unity3d.com/threads/zone-id.321109/

The zone IDs for your game are listed under the $$anonymous$$onetization Settings tab of your game profile.

 Select your game profile from the Games page.
 Select the $$anonymous$$onetization Settings tab.
 Select the Show Advanced Settings button.
 Observe the ID column under Ad Placements.
avatar image cdm89 fedecaccia · May 03, 2016 at 09:51 PM 0
Share

Thank you very much! I only see an integration ID column so it must be that. However when i test this on my iphone it lets me skip ads even though it should be a rewarded video. Any advice?

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to make sure everything's working fine in Unity Ads? 0 Answers

Tried Everything, Cant get ads to show! 0 Answers

admobdemo.cs is giving me an error 1 Answer

Admob Rewarded Video are not showing 0 Answers

How do you monetize games for Windows Phone, Windows (PC) and the Web? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges