资源简介
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游戏源代码之魔塔2013
- Android support.v7包
- 手机蓝牙控制继电器android源码
- Android实现支付宝支付从底部弹窗效果
- 连接android和php+mysql(wamp)数据库
- android 日历源码
- android sqlite数据库使用
- ZipCenOp.jar
- android_蓝牙
- android json的demo
- Android MediaCodec解码AAC,AudioTrack播放
- Android模拟时钟自定义控件
- Android自定义圆弧进度条手动控制进度
- android手机三(四)等水准记录手簿
- appium_android.js&adb;.js
- Android Socket 文件传输
- Android资源评论工具类
- Android记账源代码
- android中MVP模式一
- Android理财软件--天天记账的设计--论文
- IMToken核心源码-Android
- pdf在线预览,适用于pc android ios
- xamarin android使用zxing扫描二维码
- android图库 gallery apk
- Android 获取Gps信息的程序源码
- Android tab 栏居中滚动
- android使用Sqlite在一个库中建多张表
- Android端不通过登录SDK实现QQ登录验证
- 安卓 识别来电是否为被转移来电
- 血糖记录软件-android源代码
评论
共有 条评论