1 Star 1 Fork 0

billwillman/UnityResourceMgr

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Cocos2dxHandler.java 2.34 KB
一键复制 编辑 原始数据 按行查看 历史
billwillman 提交于 2018-06-26 17:40 +08:00 . [修改]注释掉日志
package com.example.crossgate;
import java.lang.ref.WeakReference;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
public class Cocos2dxHandler extends Handler {
// ===========================================================
// Constants
// ===========================================================
public final static int HANDLER_SHOW_DIALOG = 1;
public final static int HANDLER_SHOW_EDITBOX_DIALOG = 2;
// ===========================================================
// Fields
// ===========================================================
private WeakReference<Activity> mActivity;
// ===========================================================
// Constructors
// ===========================================================
public Cocos2dxHandler(Activity activity) {
this.mActivity = new WeakReference<Activity>(activity);
}
public void handleMessage(Message msg)
{
switch (msg.what) {
case Cocos2dxHandler.HANDLER_SHOW_DIALOG:
// ֧
//showDialog(msg);
break;
case Cocos2dxHandler.HANDLER_SHOW_EDITBOX_DIALOG:
showEditBoxDialog(msg);
break;
}
}
private void showEditBoxDialog(Message msg) {
// Log.i("Unity", "showEditBoxDialog");
EditBoxMessage editBoxMessage = (EditBoxMessage)msg.obj;
Cocos2dxEditBoxDialog dialog = new Cocos2dxEditBoxDialog(this.mActivity.get(),
editBoxMessage.title,
editBoxMessage.content,
editBoxMessage.inputMode,
editBoxMessage.inputFlag,
editBoxMessage.returnType,
editBoxMessage.maxLength);
dialog.InitUnityMethod(editBoxMessage.gameObjName, editBoxMessage.methodName);
dialog.show();
}
public static class EditBoxMessage {
public String title;
public String content;
public int inputMode;
public int inputFlag;
public int returnType;
public int maxLength;
public String gameObjName;
public String methodName;
public EditBoxMessage(String title, String content, int inputMode, int inputFlag, int returnType, int maxLength, String gameObj, String method){
this.content = content;
this.title = title;
this.inputMode = inputMode;
this.inputFlag = inputFlag;
this.returnType = returnType;
this.maxLength = maxLength;
this.gameObjName = gameObj;
this.methodName = method;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/billwillman/UnityResourceMgr.git
git@gitee.com:billwillman/UnityResourceMgr.git
billwillman
UnityResourceMgr
UnityResourceMgr
master

搜索帮助