Example #1
0
 void GetFreeCoin(RiseSdk.AdEventType result, string tag, int rewardId)
 {
     if (result == RiseSdk.AdEventType.RewardAdShowFinished)
     {
         switch (rewardId)
         {
         case 1:
             // you can add random golds, eg. 10
             //player.gold += 10;
             break;
         }
         Debug.LogError("RewardAdShowFinished, " + tag + ", " + rewardId);
     }
     else if (result == RiseSdk.AdEventType.RewardAdLoadCompleted)
     {
         Debug.LogError("RewardAdLoadCompleted, " + tag + ", " + rewardId);
     }
     else if (result == RiseSdk.AdEventType.RewardAdLoadFailed)
     {
         Debug.LogError("RewardAdLoadFailed, " + tag + ", " + rewardId);
     }
     else if (result == RiseSdk.AdEventType.RewardAdShowStart)
     {
         Debug.LogError("RewardAdShowStart, " + tag + ", " + rewardId);
     }
 }
Example #2
0
    public void adDidClick(string data)
    {
        if (OnAdEvent != null && OnAdEvent.GetInvocationList().Length > 0)
        {
            string tag    = "Default";
            int    adType = RiseSdk.ADTYPE_INTERTITIAL;
            if (!string.IsNullOrEmpty(data))
            {
                string[] str = data.Split('|');
                if (str.Length == 1)
                {
                    tag = str[0];
                }
                else if (str.Length >= 2)
                {
                    tag = str[0];
                    int.TryParse(str[1], out adType);
                }
            }
            RiseSdk.AdEventType eventType = RiseSdk.AdEventType.FullAdClicked;
            switch (adType)
            {
            case RiseSdk.ADTYPE_INTERTITIAL:
                eventType = RiseSdk.AdEventType.FullAdClicked;
                break;

            case RiseSdk.ADTYPE_VIDEO:
                eventType = RiseSdk.AdEventType.VideoAdClicked;
                break;

            case RiseSdk.ADTYPE_BANNER:
                eventType = RiseSdk.AdEventType.BannerAdClicked;
                break;

            case RiseSdk.ADTYPE_ICON:
                eventType = RiseSdk.AdEventType.IconAdClicked;
                break;

            case RiseSdk.ADTYPE_NATIVE:
                eventType = RiseSdk.AdEventType.NativeAdClicked;
                break;
            }
            //OnAdEvent (RiseSdk.AdEventType.AdClicked, -1, tag, adType);
            OnAdEvent(eventType, -1, tag, adType);
        }
    }
Example #3
0
    // Get Free coin handler
#if UNITY_ANDROID
    void GetFreeCoin(RiseSdk.AdEventType result, int rewardId, string tag, int adType)
    {
        if (result == RiseSdk.AdEventType.RewardAdShowFinished)
        {
            switch (rewardId)
            {
            case 1:
                // you can add random golds, eg. 10
                //player.gold += 10;
                break;
            }
            Debug.LogError("success: free coin: " + rewardId + ", " + tag);
        }
        else if (result == RiseSdk.AdEventType.RewardAdShowFailed)
        {
            Debug.LogError("fails: free coin: " + rewardId + ", " + tag);
        }
    }