// Update is called once per frame
    void Update()
    {
        // currencyText.text = ("Credits: " + ADCAdManager.GetRegularCurrencyAmount());
        PlayVideoZoneButton playVideoZoneButton = currencyButton.GetComponent <PlayVideoZoneButton>();

        currencyText.text = (AdColony.GetV4VCName(ADCAdManager.GetZoneIdByKey(playVideoZoneButton.zoneIdKey)) + ": " + ADCAdManager.GetRegularCurrencyAmount());
    }
    public static bool IsVideoAvailableByZoneKey(string zoneKey)
    {
        bool isZoneAvailable = false;

        if (ContainsZoneKey(zoneKey))
        {
            ADCVideoZone videoZone = ADCAdManager.GetVideoZoneObjectByKey(zoneKey);
            if (videoZone != null)
            {
                if (videoZone.zoneType == ADCVideoZoneType.Interstitial)
                {
                    if (AdColony.IsVideoAvailable(videoZone.zoneId))
                    {
                        isZoneAvailable = true;
                    }
                }
                else if (videoZone.zoneType == ADCVideoZoneType.V4VC)
                {
                    if (AdColony.IsV4VCAvailable(videoZone.zoneId))
                    {
                        isZoneAvailable = true;
                    }
                }
                else
                {
                    //Check nothing, video zone type isn't correct
                }
            }
        }
        return(isZoneAvailable);
    }
Beispiel #3
0
 public void OnAvailabilityChange(bool availability, string zoneId)
 {
     if (ADCAdManager.GetZoneIdByKey(zoneIdKey) == zoneId)
     {
         UpdateReadyTexture(availability);
     }
 }
Beispiel #4
0
    // Use this for initialization
    public override void Start()
    {
        base.Start();
        zoneId = ADCAdManager.GetZoneIdByKey(zoneIdKey);
        ADCAdManager.AddOnAdAvailabilityChangeMethod(OnAvailabilityChange);

        UpdateReadyTexture(AdColony.IsVideoAvailable(zoneId));
    }
 public static string GetZoneIdByKey(string key)
 {
     key = key.ToLower();
     if (ContainsZoneKey(key))
     {
         return(ADCAdManager.GetVideoZonesDictionary()[key].zoneId);
     }
     else
     {
         return("");
     }
 }
 public static ADCVideoZone GetVideoZoneObjectByKey(string key)
 {
     key = key.ToLower();
     if (ContainsZoneKey(key))
     {
         return(ADCAdManager.GetVideoZonesDictionary()[key]);
     }
     else
     {
         return(null);
     }
 }
 public static void AddZoneToManager(string zoneKey, string zoneId, ADCVideoZoneType videoZoneType)
 {
     zoneKey = zoneKey.ToLower();
     if (ContainsZoneKey(zoneKey))
     {
         Debug.LogWarning("The ad manager overwrote the previous video zoneId: " + GetZoneIdByKey(zoneKey) + " for the video zone named " + zoneKey + " with the new video zoneId of: " + zoneId);
     }
     else
     {
         Debug.LogWarning("The ad manager has added the video zone named " + zoneKey + " with the video zoneId of: " + zoneId);
         ADCAdManager.GetVideoZonesDictionary().Add(zoneKey, new ADCVideoZone(zoneId, videoZoneType));
     }
 }
Beispiel #8
0
 // Update is called once per frame
 void Update()
 {
     currencyText.text = ("Credits: " + ADCAdManager.GetRegularCurrencyAmount());
 }
 public static void RemoveZoneFromManager(string zoneKey)
 {
     zoneKey = zoneKey.ToLower();
     ADCAdManager.GetVideoZonesDictionary().Remove(zoneKey);
 }
 //---------------------------------------------------------------------------
 // Zone Manager General Methods
 //---------------------------------------------------------------------------
 public static void ResetADCAdManagerZones()
 {
     ADCAdManager.GetVideoZonesDictionary().Clear();
 }
Beispiel #11
0
 public override void PerformButtonPressLogic()
 {
     ADCAdManager.ShowVideoAdByZoneKey(zoneIdKey, true, false);
 }
Beispiel #12
0
    //---------------------------------------------------------------------------

    // Use this for initialization
    public override void Start()
    {
        base.Start();
        ADCAdManager.AddOnAdAvailabilityChangeMethod(OnAvailabilityChange);
        UpdateReadyTexture(ADCAdManager.IsVideoAvailableByZoneKey(zoneIdKey));
    }