示例#1
0
    private void SwitchAdPlatform(UM_AdPlatform platfrom)
    {
        Debug.Log(platfrom + " Selected.");
        m_adsClient = UM_AdvertisementService.GetClient(platfrom);

        if (m_adsClient == null)
        {
            ShowMessage("Error", "Cleint not configured");
            SetInteractable(false);
        }
        else
        {
            if (m_adsClient.IsInitialized)
            {
                SetInteractable(true);
                ShowMessage(platfrom.ToString(), platfrom.ToString() + " advertesment platfrom is ready to be used.");
            }
            else
            {
                SetInteractable(false);
                m_adsClient.Initialize((result) => {
                    if (result.IsSucceeded)
                    {
                        SetInteractable(true);
                        ShowMessage(platfrom.ToString(), platfrom.ToString() + " advertesment platfrom is ready to be used.");
                    }
                    else
                    {
                        ShowMessage(platfrom.ToString() + " failed to init", result.Error.FullMessage);
                    }
                });
            }
        }
    }
示例#2
0
    void Start()
    {
        m_adsClient = UM_AdvertisementService.GetClient(UM_AdPlatform.Google);

        if (m_adsClient == null)
        {
            Debug.Log("Cleint not configured");
        }
        else
        {
            if (m_adsClient.IsInitialized)
            {
                Debug.Log("Advertesment platfrom is ready to be used");
            }
            else
            {
                m_adsClient.Initialize((result) => {
                    if (result.IsSucceeded)
                    {
                        Debug.Log("Advertesment platfrom is ready to be used");
                    }
                    else
                    {
                        Debug.Log("Advertesment platfrom is failed to init");
                    }
                });
            }
        }
    }