多平台
#if UNITY_EDITOR
if(Input.GetMouseButtonUp(0))
#elif UNITY_ANDROID || UNITY_IPHONE
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
#endif
{
}
计算md5
private string GetMd5(string msg)
{
string cryptStr = "";
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
byte[] bytes = Encoding.UTF8.GetBytes(msg);
byte[] cryptBytes = md5.ComputeHash(bytes);
for (int i = 0; i < cryptBytes.Length; i++)
{
cryptStr += cryptBytes[i].ToString("X2");
}
return cryptStr;
}
private void BuildAns(string s)
{
Debug.Log(GetMd5(GetMd5(s)).Remove(8));
}
Destroy不能立马销毁。
DestroyImmediate(gameObj);可以
网友评论