コード例 #1
0
 // Use this for initialization
 void Start()
 {
     showBtn.onClick.AddListener(showBtnClick);
     loadBtn.onClick.AddListener(loadBtnClick);
     //Notice: load Interstitial ad when you init UI.
     CTService.preloadInterstitialWithSlotId(slot_id);
 }
コード例 #2
0
 void Start()
 {
     playBtn.onClick.AddListener(playBtnClick);
     loadBtn.onClick.AddListener(loadBtnClick);
     //Notice: load rewardvideo ad when you init UI.
     CTService.loadRewardVideoWithSlotId(slot_id);
 }
コード例 #3
0
 void showBtnClick()
 {
     //you can also use this api to check if Interstitial is ready.
     if (CTService.isInterstitialAvailable())
     {
         setReady(true, null);
         CTService.showInterstitial();
     }
     else
     {
         Debug.Log("CT Interstitial is not ready");
     }
 }
コード例 #4
0
 void playBtnClick()
 {
     //you can also use this api to check if rewearded video is ready.
     if (CTService.checkRewardVideoIsReady())
     {
         setReady(true, null);
         CTService.showRewardVideo(slot_id);
     }
     else
     {
         Debug.Log("CT Rewarded Video is not ready");
     }
 }
コード例 #5
0
 void Awake()
 {
     CTService.loadRequestGetCTSDKConfigBySlot_id(slot_id);
     CTService.uploadConsent("yes", "GDPR");
 }
コード例 #6
0
 void loadBtnClick()
 {
     //load Interstitial ad
     CTService.preloadInterstitialWithSlotId(slot_id);
     Debug.Log("CT Interstitial loadBtnClick");
 }
コード例 #7
0
 void OnDestroy()
 {
     //do not forget to call release, otherwise android platform will casue memory leak.
     CTService.release();
 }
コード例 #8
0
 //Notice: You should call this api as soon as you can. For example, call it in Start function.(not in awake, beacause we must call CTService.loadRequestGetCTSDKConfigBySlot_id first in camera awake function)
 //For convenience test, we add a button to click.
 void loadBtnClick()
 {
     //load rewardvideo ad
     CTService.loadRewardVideoWithSlotId(slot_id);
 }