|
unity3d在操作过程中会有很多的字符串内容,我们在操作的时候往往会觉得很头疼,不知道各种各样的字符串到底是怎么来操作以及运行,也不知道各个字符串本身的实际作用到底是什么。我们今天就一起来看看unity3d的字符串操作代码的相关信息。具体介绍如下:'追加无符号16进制编码 Private Function AddUnsigned(byVal lX, byVal lY) Dim lX4 Dim lY4 Dim lX8 Dim lY8 Dim lResult lX8 = lX And &H80000000 lY8 = lY And &H80000000 lX4 = lX And &H40000000 lY4 = lY And &H40000000 lResult = (lX And &H3FFFFFFF) + (lY And &H3FFFFFFF) If lX4 And lY4 Then lResult = lResult Xor &H80000000 Xor lX8 Xor lY8 ElseIf lX4 or lY4 Then If lResult And &H40000000 Then lResult = lResult Xor &HC0000000 Xor lX8 Xor lY8 Else lResult = lResult Xor &H40000000 Xor lX8 Xor lY8 End If Else lResult = lResult Xor lX8 Xor lY8 End If AddUnsigned = lResult End Function 'MD5_FF,MD5_GG,MD5_HH,MD5_II MD5主编码函数 Private Sub MD5_FF(a, b, c, d, x, s, ac) a = AddUnsigned(a, AddUnsigned(AddUnsigned(MD5_F(b, c, d), x), ac)) a = RotateLeft(a, s) a = AddUnsigned(a, b) End Sub Private Sub MD5_GG(a, b, c, d, x, s, ac) a = AddUnsigned(a, AddUnsigned(AddUnsigned(MD5_G(b, c, d), x), ac)) a = RotateLeft(a, s) a = AddUnsigned(a, b) End Sub Private Sub MD5_HH(a, b, c, d, x, s, ac) a = AddUnsigned(a, AddUnsigned(AddUnsigned(MD5_H(b, c, d), x), ac)) a = RotateLeft(a, s) a = AddUnsigned(a, b) End Sub Private Sub MD5_II(a, b, c, d, x, s, ac) a = AddUnsigned(a, AddUnsigned(AddUnsigned(MD5_I(b, c, d), x), ac)) a = RotateLeft(a, s) a = AddUnsigned(a, b) End Sub 'MD5_F,MD5_G,MD5_H,MD5_I MD5辅编码函数 Private Function MD5_F(x, y, z) MD5_F = (x And y) or ((Not x) And z) End Function Private Function MD5_G(x, y, z) MD5_G = (x And z) or (y And (Not z)) End Function Private Function MD5_H(x, y, z) MD5_H = (x Xor y Xor z) End Function Private Function MD5_I(x, y, z) MD5_I = (y Xor (x or (Not z))) End Function 上述给大家进行介绍的是unity3d当中非常简单的一些字符串操作代码。我们自己在学习以及掌握的时候只要是能够注意从最为基础的知识内容开始理解,自己再慢慢的结合一些实际性的操作内容来进行学习,那么要想学好unity3d其实也可以很容易。
|