Unity yield WaitForSeconds(1);

IEnumerator WaitFunction (float delay) {
float timer = Time.time + delay;
while (Time.time < timer) {
yield return null;
}
}
IEnumerator Start () {
yield return StartCoroutine(WaitFunction (1.0f));
print (“1”);
yield return StartCoroutine(WaitFunction (2.0f));
print (“2”);

}

minigameDatazone

穿透  —
matrix不对
comp下资源————————–
“comp/bg.png”,
“comp/blank.png”,
“comp/btn_close.png”,
“comp/button.png”,
“comp/checkbox.png”,
“comp/clip_num.png”,
“comp/clip_selectBox.png”,
“comp/clip_tree_arrow.png”,
“comp/clip_tree_folder.png”,
“comp/combobox.png”,
“comp/hscroll$bar.png”,
“comp/hscroll$down.png”,
“comp/hscroll$up.png”,
“comp/hscroll.png”,
“comp/hslider$bar.png”,
“comp/hslider.png”,
“comp/html.png”,
“comp/image.png”,
“comp/label.png”,
“comp/linkbutton.png”,
“comp/progress$bar.png”,
“comp/progress.png”,
“comp/radio.png”,
“comp/radiogroup.png”,
“comp/tab.png”,
“comp/textarea.png”,
“comp/textinput.png”,
“comp/vscroll$bar.png”,
“comp/vscroll$down.png”,
“comp/vscroll$up.png”,
“comp/vscroll.png”,
“comp/vslider$bar.png”,
“comp/vslider.png”

android 退出提示

//    private long firstTime = 0;
//    @Override
//    public void onBackPressed() {
//        long secondTime = System.currentTimeMillis();
//        if (secondTime - firstTime > 2000) {
//            Toast.makeText(MainActivity.this, "再按一次退出程序", Toast.LENGTH_SHORT).show();
//            firstTime = secondTime;
//        } else {
//            System.exit(0);
//        }
//    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
            dialog();
            return true;
        }
        return true;
    }

    protected void dialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
        builder.setMessage("是否退出游戏");
        builder.setTitle("提示");
        builder.setPositiveButton("确认",
                new android.content.DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                        android.os.Process.killProcess(android.os.Process.myPid());
                    }
                });
        builder.setNegativeButton("取消",
                new android.content.DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                });
        builder.create().show();
    }

adb shell

adb shell /system/bin/screencap -p /sdcard/screenshot.png(保存到SDCard)
adb pull /sdcard/screenshot.png d:/screenshot.png(保存到电脑)

$ adb shell screencap -p /sdcard/screen.png 1. 截图保存到sdcard

$ adb pull /sdcard/screen.png 2.将图片导出

$ adb shell rm /sdcard/screen.png 3.删除sdcard中的图片

 

Android – adb shell input : Keyevent , tap , swipe

Desc :

模拟事件全部是通过input命令来实现的,首先看一下input命令的使用:

 

usage: input …

input text <string>
input keyevent <key code number or name>
input tap <x> <y>
input swipe <x1> <y1> <x2> <y2>

 

1. keyevent指的是android对应的keycode,比如home键的keycode=3,back键的keycode=4.

具体请查阅 <android keycode详解> http://blog.csdn.net/huiguixian/article/details/8550170

然后使用的话比较简单,比如想模拟home按键:

adb shell input keyevent 3

模拟 按下 Power 键

adb shell input keyevent 26

请查阅上述文章,根据具体keycode编辑即可。

 

 

2. 关于tap的话,他模拟的是touch屏幕的事件,只需给出x、y坐标即可。

此x、y坐标对应的是真实的屏幕分辨率,所以要根据具体手机具体看,比如你想点击屏幕(x, y) = (250, 250)位置:

adb shell input tap 250 250

 

3. 关于swipe同tap是一样的,只是他是模拟滑动的事件,给出起点和终点的坐标即可。例如从屏幕(250, 250), 到屏幕(300, 300)即

adb shell input swipe 250 250 300 300

 

给深度学习入门者的Python快速教程 – Numpy和Matplotlib篇