Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
1
Question by OttoClausen · Oct 23, 2016 at 11:05 AM · pluginadsadmobvolumemute

Admob Unity Plugin - Mute interstitial ads

Hey guys I am really hoping for some help on this one. In my game I have a button that once pressed mutes all sound and music. I have monetized my game with Google Admob and I am using the official Admob Unity Plugin. My problem is that when an interstitial is shown it is not muted. I want to mute my ads when my game is muted. Can anyone help me accomplish this?

My script for displaying ads looks like this:

 using UnityEngine;
 using System.Collections;
 using GoogleMobileAds.Api;
 
 public class AdmobScript : MonoBehaviour {
 
     private static string interstitialId;
     private static InterstitialAd interstitial;
     private static AdRequest interstitialRequest;
     public static int counter;
 
     void Awake()
     {
         DontDestroyOnLoad(gameObject);
     }
         
     void Start () 
     {
         #if UNITY_ANDROID
         interstitialId = "ca-app-pub-1518441074738585/3382052954";
         #elif UNITY_IPHONE
         interstitialId = "ca-app-pub-1518441074738585/2544448158";
         #else
         interstitialId = "unexpected platform";
         #endif
 
         counter = 0;
         requestInterstitial ();
     }
     
     public static void requestInterstitial()
     {
         interstitial = new InterstitialAd (interstitialId);
         interstitialRequest = new AdRequest.Builder ().TagForChildDirectedTreatment(true).Build ();
         interstitial.LoadAd (interstitialRequest);
     }
 
     public static void showInterstitial()
     {
         if (interstitial.IsLoaded()) 
         {
             interstitial.Show ();
         }
     }
 
     public static bool isAdReady()
     {
         return interstitial.IsLoaded ();
     }
 }

Comment
Add comment · Show 1
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 matt_unity258 · Oct 09, 2018 at 08:15 AM 0
Share

Did you ever figure this out @OttoClausen?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by OttoClausen · Oct 09, 2018 at 11:14 AM

It was not possible back then. I don't know if it is now.

Comment
Add comment · 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

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

78 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 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 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

AdMob Plugin doesnt work in any case 1 Answer

Unity Admob Interstitial shows errors? 0 Answers

Problem playing AdMob 1 Answer

Unity Interstitial problem 1 Answer

Help with AdMob interstitials 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