资源简介
unity android obb

代码片段和文件信息
package com.mydemo.test;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Set;
import com.unity3d.player.UnityPlayer;
import com.unity3d.player.UnityPlayerActivity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.storage.OnObbStateChangeListener;
import android.os.storage.StorageManager;
import android.view.KeyEvent;
import android.content.res.Configuration;
import android.widget.Toast;
import android.util.Log;
import android.view.WindowManager;
import android.provider.Settings.System;
public class MainActivity extends UnityPlayerActivity {
//这些东西都是与google obb有关的
//拷贝到项目主Activity中
/* google obb */
public String UnityGetObbPath() {
String obbPath = getObbDir().getPath();
// Log.v(“debug“obbPath);
return obbPath;
}
public String UnityGetAbsoluteObbPath() {
String absobbPath = getObbDir().getAbsolutePath();
// Log.v(“debug““Abs ObbPath is “);
// Log.v(“debug“absobbPath);
return absobbPath;
}
public String UnityGetMountedPath(String rawPath) {
final StorageManager storageManager = (StorageManager) getSystemService(STORAGE_SERVICE);
String mountedObbPath = storageManager.getMountedObbPath(rawPath);
return mountedObbPath;
}
public boolean UnityMountObb(String rawPath) {
final StorageManager storageManager = (StorageManager) getSystemService(STORAGE_SERVICE);
boolean isAddToQueue = storageManager.mountObb(rawPath null
new OnObbStateChangeListener() {
@Override
public void onObbStateChange(String path int state) {
super.onObbStateChange(path state);
switch (state) {
case ERROR_ALREADY_MOUNTED:
Log.v(“Unity“ “The OBB has already been mounted“);
case ERROR_COULD_NOT_MOUNT:
Log.v(“Unity“
“The OBB could not be mounted by the system“);
break;
case ERROR_COULD_NOT_UNMOUNT:
Log.v(“Unity“ “The OBB could not be unmounted“);
break;
case ERROR_INTERNAL:
Log.v(“Unity“
“There was an internal system error encountered while trying to mount the OBB“);
break;
case ERROR_NOT_MOUNTED:
Log.v(“Unity“
“A call was made to unmount the OBB when it was not mounted“);
break;
case ERROR_PERMISSION_DENIED:
Log.v(“Unity“
“The current application does not have permission to use this OBB“);
break;
case MOUNTED:
Log.v(“Unity“
“The OBB container is now mounted and ready for use“);
break;
case UNMOUNTED:
Log.v(“Unity“
“The OBB container is now unmounted and not usable.“);
break;
default:
break;
}
}
});
return isAddToQueu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3244 2016-04-27 20:42 unity android obb\MainActivity.java
文件 3273 2016-04-28 10:19 unity android obb\ObbPathUtility.cs
目录 0 2016-04-28 10:20 unity android obb
----------- --------- ---------- ----- ----
6517 3
相关资源
- android毕业设计
- 百度地图自定义Markerandroid
- Android分区工具包
- android-support-v4.jar已打包进去源代码
- u-blox_Android_GNSS_Driver_v3.10驱动源码+中
- 个人根据Android移动开发案例详解手写
- android 视频播放器 项目和原码
- Android【动画】【特效】 17种动画特效
- 基于Android智能家居详细设计(经典)
- android通过JDBC连接Mysql数据库
- Android通讯录的源代码
- android 瀑布流Demo
- 指纹传感器FPC1080在android下的驱动
- delphi xe5 android 调用照相机摄像头拍照
- Android手机连连看游戏源码
- android-sdk-windows v2.3离线完整版
- android 底部弹出菜单(带透明背景)
- Android工程模式简介.rar
- Android蓝牙和Cors网络开发源码
- Android powermanger wakelock
- Android v7的一些jar包
- 最新android supportV7包
- android图片压缩工具类分享
- 单机搭建Android(解决Network is unreach
- Android上监听收到的短信(SMS)
- android电商app源码
- Android代码-多功能拨号盘源码.zip
- printershare直接破解版--11.5(适配andr
- android RDP远程桌面客户端源码
- 手机远程控制手机android
评论
共有 条评论