一直在想,使用模拟按键,也可以实现一些AI操作,具体还没做过,这里使用user32.dll在unity里写的一个简单demo using UnityEngine; using System.Collections; using System.Runtime.InteropServices; public class GetKeyCodeKey : MonoBehaviour { [DllImport("user32.dll", EntryPoint = "keybd_even
有时候我们会遇到很多形式的日期判断,甚至是并不常见的日期形式,比如20161212之类的日期,下面就此来进行代码是否处于当天的日期校验的代码实现来做一个整理. public static boolean isToday(String str, String formatStr) throws Exception{ SimpleDateFormat format = new SimpleDateFormat(formatStr); Date date = null; try { date = fo