|
资源信息 Asset Information
资源名称: | Unity IOS常用代码控制源码 带测试场景 (发帖教程) |
版本: | 无 (版本) |
资源等级: | 1 |
资源格式: | .unitypackage (链接失效请点击帖子右下方举报通知管理员) |
资源大小: | 8MB (默认:MB) |
下载地址: | 链接:http://pan.baidu.com/s/1qXAxuFy 密码:lwcl (购买积分) |
- using UnityEngine;
- using System.Collections.Generic;
- public class MobclixGUIManager : MonoBehaviour
- {
- void OnStart()
- {
- Screen.orientation = ScreenOrientation.LandscapeLeft;
- }
-
-
- void OnGUI()
- {
- float yPos = 5.0f;
- float xPos = 20.0f;
- float width = 210.0f;
- float height = 40.0f;
- float heightPlus = 45.0f;
-
-
- if( GUI.Button( new Rect( xPos, yPos, width, height ), "Initialize Mobclix" ) )
- {
- MobclixBinding.start();
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Show Banner" ) )
- {
- MobclixBinding.showBanner();
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Hide Banner" ) )
- {
- MobclixBinding.hideBanner( true );
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Request Full Screen Ad" ) )
- {
- MobclixBinding.requestFullScreenAd();
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Is Full Screen Ad Loaded?" ) )
- {
- Debug.Log( "is full screen ad ready? " + MobclixBinding.isFullScreenAdReady() );
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Display Full Screen Ad" ) )
- {
- MobclixBinding.displayFullScreenAd();
- }
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Request and Display Full Screen" ) )
- {
- MobclixBinding.requestAndDisplayFullScreenAd();
- }
-
-
- xPos = Screen.width - width - 20.0f;
- yPos = 5.0f;
-
- if( iPhoneSettings.generation != iPhoneGeneration.iPad1Gen )
- {
- if( GUI.Button( new Rect( xPos, yPos, width, height ), "320x50 Banner" ) )
- {
- MobclixBinding.createBanner( MobclixBannerType.iPhone_320x50, ( Screen.width - 320 ) / 2, 0 );
- }
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "320x250 Banner" ) )
- {
- MobclixBinding.createBanner( MobclixBannerType.iPhone_300x250, ( Screen.width - 300 ) / 2, 0 );
- }
- }
- else
- {
- if( GUI.Button( new Rect( xPos, yPos, width, height ), "120x600 Banner" ) )
- {
- MobclixBinding.createBanner( MobclixBannerType.iPad_120x600, ( Screen.width - 120 ) / 2, 0 );
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "468x60 Banner" ) )
- {
- MobclixBinding.createBanner( MobclixBannerType.iPad_468x60, 0, 0 );
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "728x90 Banner" ) )
- {
- MobclixBinding.createBanner( MobclixBannerType.iPad_728x90, ( Screen.width - 728 ) / 2, 0 );
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "300x250 Banner" ) )
- {
- MobclixBinding.createBanner( MobclixBannerType.iPad_300x250, ( Screen.width - 300 ) / 2, 0 );
- }
- }
-
-
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Force Portrait Banner" ) )
- {
- MobclixBinding.rotateToOrientation( DeviceOrientation.Portrait );
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Force LandcapeLeft Banner" ) )
- {
- MobclixBinding.rotateToOrientation( DeviceOrientation.LandscapeLeft );
- }
-
-
- if( GUI.Button( new Rect( xPos, yPos += heightPlus, width, height ), "Force LandcapeRight Banner" ) )
- {
- MobclixBinding.rotateToOrientation( DeviceOrientation.LandscapeRight );
- }
- }
- }
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
×
评分
-
查看全部评分
|